@porsche-design-system/components-react
Version:
Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.
141 lines (140 loc) • 5.4 kB
TypeScript
import type { BaseProps } from '../../BaseProps';
import type { ButtonTileAlign, SelectedAriaAttributes, ButtonTileAriaAttribute, BreakpointCustomizable, ButtonTileAspectRatio, ButtonTileIcon, ButtonTileSize, ButtonTileType, ButtonTileWeight } from '../types';
export type PButtonTileProps = BaseProps & {
/**
* Controls the vertical placement of the description and button — `top` or `bottom`.
* @default 'bottom'
*/
align?: ButtonTileAlign;
/**
* Sets ARIA attributes on the tile's action button to improve accessibility for screen readers.
*/
aria?: SelectedAriaAttributes<ButtonTileAriaAttribute>;
/**
* Sets the width-to-height ratio of the tile media area. Supports responsive breakpoint values.
* @default '4/3'
*/
aspectRatio?: BreakpointCustomizable<ButtonTileAspectRatio>;
/**
* Renders only the icon button without the full label. Supports responsive breakpoint values.
* @default false
*/
compact?: BreakpointCustomizable<boolean>;
/**
* Sets the description text displayed in the tile's content area.
*/
description: string;
/**
* Disables the tile, preventing button interaction.
* @default false
*/
disabled?: boolean;
/**
* Shows a gradient overlay over the media slot to improve text legibility on bright images or videos.
* @default false
*/
gradient?: boolean;
/**
* Sets the icon displayed in the tile's action button. Use `none` to show no icon.
* @default 'none'
*/
icon?: ButtonTileIcon;
/**
* Sets a path to a custom SVG icon for the action button, used instead of the built-in icon set.
*/
iconSource?: string;
/**
* Sets the accessible label text of the action button rendered inside the tile.
*/
label: string;
/**
* Disables the tile and shows a loading spinner to indicate an ongoing operation.
* @default false
*/
loading?: boolean;
/**
* Sets the font size of the description text in the tile content area. Supports responsive breakpoint values.
* @default 'medium'
*/
size?: BreakpointCustomizable<ButtonTileSize>;
/**
* Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action.
* @default 'submit'
*/
type?: ButtonTileType;
/**
* Sets the font weight of the description text in the tile content area. Supports responsive breakpoint values.
* @default 'semi-bold'
*/
weight?: BreakpointCustomizable<ButtonTileWeight>;
};
export declare const PButtonTile: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "inputMode" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
/**
* Controls the vertical placement of the description and button — `top` or `bottom`.
* @default 'bottom'
*/
align?: ButtonTileAlign;
/**
* Sets ARIA attributes on the tile's action button to improve accessibility for screen readers.
*/
aria?: SelectedAriaAttributes<ButtonTileAriaAttribute>;
/**
* Sets the width-to-height ratio of the tile media area. Supports responsive breakpoint values.
* @default '4/3'
*/
aspectRatio?: BreakpointCustomizable<ButtonTileAspectRatio>;
/**
* Renders only the icon button without the full label. Supports responsive breakpoint values.
* @default false
*/
compact?: BreakpointCustomizable<boolean>;
/**
* Sets the description text displayed in the tile's content area.
*/
description: string;
/**
* Disables the tile, preventing button interaction.
* @default false
*/
disabled?: boolean;
/**
* Shows a gradient overlay over the media slot to improve text legibility on bright images or videos.
* @default false
*/
gradient?: boolean;
/**
* Sets the icon displayed in the tile's action button. Use `none` to show no icon.
* @default 'none'
*/
icon?: ButtonTileIcon;
/**
* Sets a path to a custom SVG icon for the action button, used instead of the built-in icon set.
*/
iconSource?: string;
/**
* Sets the accessible label text of the action button rendered inside the tile.
*/
label: string;
/**
* Disables the tile and shows a loading spinner to indicate an ongoing operation.
* @default false
*/
loading?: boolean;
/**
* Sets the font size of the description text in the tile content area. Supports responsive breakpoint values.
* @default 'medium'
*/
size?: BreakpointCustomizable<ButtonTileSize>;
/**
* Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action.
* @default 'submit'
*/
type?: ButtonTileType;
/**
* Sets the font weight of the description text in the tile content area. Supports responsive breakpoint values.
* @default 'semi-bold'
*/
weight?: BreakpointCustomizable<ButtonTileWeight>;
} & {
children?: import("react").ReactNode | undefined;
} & import("react").RefAttributes<HTMLElement>>;