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.

59 lines (58 loc) 2.67 kB
import type { BaseProps } from '../../BaseProps'; import type { SelectedAriaAttributes, SegmentedControlItemAriaAttribute, SegmentedControlItemIcon } from '../types'; export type PSegmentedControlItemProps = BaseProps & { /** * Sets ARIA attributes on the item's button element to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<SegmentedControlItemAriaAttribute>; /** * Prevents this item from being selected and visually dims it; the parent's value will not change to this item's value. * @default false */ disabled?: boolean; /** * Sets an icon rendered inside the item button using an icon name from the PDS icon library. */ icon?: SegmentedControlItemIcon; /** * Sets a URL to a custom SVG icon for the item button, overriding the built-in icon set. */ iconSource?: string; /** * Sets a visible text label rendered inside the item button, used when no slotted content is provided. */ label?: string; /** * Sets the value emitted by the parent `p-segmented-control` when this item is selected. This property is **required**. */ value: string | number; }; export declare const PSegmentedControlItem: 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 item's button element to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<SegmentedControlItemAriaAttribute>; /** * Prevents this item from being selected and visually dims it; the parent's value will not change to this item's value. * @default false */ disabled?: boolean; /** * Sets an icon rendered inside the item button using an icon name from the PDS icon library. */ icon?: SegmentedControlItemIcon; /** * Sets a URL to a custom SVG icon for the item button, overriding the built-in icon set. */ iconSource?: string; /** * Sets a visible text label rendered inside the item button, used when no slotted content is provided. */ label?: string; /** * Sets the value emitted by the parent `p-segmented-control` when this item is selected. This property is **required**. */ value: string | number; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;