UNPKG

@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.

159 lines (158 loc) 6.06 kB
import type { BaseProps } from '../../BaseProps'; import type { BreakpointCustomizable, ButtonPureAlignLabel, SelectedAriaAttributes, ButtonPureAriaAttribute, ButtonPureColor, ButtonPureIcon, ButtonPureSize, ButtonPureType } from '../types'; export type PButtonPureProps = BaseProps & { /** * Visually marks the button as the currently active or selected item, useful for navigation and toggle patterns. * @default false */ active?: boolean; /** * Sets the label position relative to the icon — `start` places it before, `end` places it after. Supports responsive breakpoint values. * @default 'end' */ alignLabel?: BreakpointCustomizable<ButtonPureAlignLabel>; /** * Sets ARIA attributes on the button to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<ButtonPureAriaAttribute>; /** * Sets the foreground color of the button's icon and label text. * @default 'primary' */ color?: ButtonPureColor; /** * Disables the button, preventing all interaction and blocking events. * @default false */ disabled?: boolean; /** * Associates the button with a form element by its ID, so it can submit or reset that form even when placed outside of it. */ form?: string; /** * Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. * @default false */ hideLabel?: BreakpointCustomizable<boolean>; /** * Sets the icon displayed next to the label. * @default 'arrow-right' */ icon?: ButtonPureIcon; /** * Sets a path to a custom SVG icon, used instead of the built-in icon set. */ iconSource?: string; /** * Disables the button and replaces its icon with a loading spinner to indicate an ongoing operation. * @default false */ loading?: boolean; /** * Sets the name submitted with the form data when this button triggers form submission. */ name?: string; /** * Sets the font size of the button label. Supports responsive breakpoint values. * @default 'sm' */ size?: BreakpointCustomizable<ButtonPureSize>; /** * Expands the space between icon and label to fill the full container width. Supports responsive breakpoint values. * @default false */ stretch?: BreakpointCustomizable<boolean>; /** * Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. * @default 'submit' */ type?: ButtonPureType; /** * Adds a text underline to the label to reinforce the button's link-like appearance. * @default false */ underline?: boolean; /** * Sets the value submitted with the form data when this button triggers form submission, paired with `name`. */ value?: string; }; export declare const PButtonPure: 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"> & { /** * Visually marks the button as the currently active or selected item, useful for navigation and toggle patterns. * @default false */ active?: boolean; /** * Sets the label position relative to the icon — `start` places it before, `end` places it after. Supports responsive breakpoint values. * @default 'end' */ alignLabel?: BreakpointCustomizable<ButtonPureAlignLabel>; /** * Sets ARIA attributes on the button to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<ButtonPureAriaAttribute>; /** * Sets the foreground color of the button's icon and label text. * @default 'primary' */ color?: ButtonPureColor; /** * Disables the button, preventing all interaction and blocking events. * @default false */ disabled?: boolean; /** * Associates the button with a form element by its ID, so it can submit or reset that form even when placed outside of it. */ form?: string; /** * Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. * @default false */ hideLabel?: BreakpointCustomizable<boolean>; /** * Sets the icon displayed next to the label. * @default 'arrow-right' */ icon?: ButtonPureIcon; /** * Sets a path to a custom SVG icon, used instead of the built-in icon set. */ iconSource?: string; /** * Disables the button and replaces its icon with a loading spinner to indicate an ongoing operation. * @default false */ loading?: boolean; /** * Sets the name submitted with the form data when this button triggers form submission. */ name?: string; /** * Sets the font size of the button label. Supports responsive breakpoint values. * @default 'sm' */ size?: BreakpointCustomizable<ButtonPureSize>; /** * Expands the space between icon and label to fill the full container width. Supports responsive breakpoint values. * @default false */ stretch?: BreakpointCustomizable<boolean>; /** * Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. * @default 'submit' */ type?: ButtonPureType; /** * Adds a text underline to the label to reinforce the button's link-like appearance. * @default false */ underline?: boolean; /** * Sets the value submitted with the form data when this button triggers form submission, paired with `name`. */ value?: string; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;