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.

119 lines (118 loc) 4.54 kB
import type { BaseProps } from '../../BaseProps'; import type { SelectedAriaAttributes, ButtonAriaAttribute, BreakpointCustomizable, ButtonIcon, ButtonType, ButtonVariant } from '../types'; export type PButtonProps = BaseProps & { /** * Sets ARIA attributes on the button to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<ButtonAriaAttribute>; /** * Reduces the button's height and padding for denser layouts. Supports responsive breakpoint values. * @default false */ compact?: BreakpointCustomizable<boolean>; /** * 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 inside the button. Use `none` to show no icon. * @default 'none' */ icon?: ButtonIcon; /** * Sets a path to a custom SVG icon, used instead of the built-in icon set. */ iconSource?: string; /** * Disables the button and replaces its content 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 button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. * @default 'submit' */ type?: ButtonType; /** * Sets the value submitted with the form data when this button triggers form submission, paired with `name`. */ value?: string; /** * Sets the visual style variant of the button (e.g. `primary`, `secondary`, `tertiary`). * @default 'primary' */ variant?: ButtonVariant; }; export declare const PButton: 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"> & { /** * Sets ARIA attributes on the button to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<ButtonAriaAttribute>; /** * Reduces the button's height and padding for denser layouts. Supports responsive breakpoint values. * @default false */ compact?: BreakpointCustomizable<boolean>; /** * 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 inside the button. Use `none` to show no icon. * @default 'none' */ icon?: ButtonIcon; /** * Sets a path to a custom SVG icon, used instead of the built-in icon set. */ iconSource?: string; /** * Disables the button and replaces its content 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 button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. * @default 'submit' */ type?: ButtonType; /** * Sets the value submitted with the form data when this button triggers form submission, paired with `name`. */ value?: string; /** * Sets the visual style variant of the button (e.g. `primary`, `secondary`, `tertiary`). * @default 'primary' */ variant?: ButtonVariant; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;