@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.
53 lines (52 loc) • 2.35 kB
TypeScript
import type { BaseProps } from '../../BaseProps';
import type { SelectedAriaAttributes, IconAriaAttribute, IconColor, IconName, BreakpointCustomizable, IconSize } from '../types';
export type PIconProps = BaseProps & {
/**
* Sets ARIA attributes on the icon — use `aria-label` to make the icon meaningful to screen readers when it conveys information.
*/
aria?: SelectedAriaAttributes<IconAriaAttribute>;
/**
* Sets the fill color of the icon using PDS color tokens.
* @default 'primary'
*/
color?: IconColor;
/**
* Selects an icon from the built-in PDS icon library by name (e.g. `arrow-right`, `close`).
* @default 'arrow-right'
*/
name?: IconName;
/**
* Sets the icon size using the PDS typographic scale. Use `inherit` to derive size from the parent element. Supports responsive breakpoint values.
* @default 'sm'
*/
size?: BreakpointCustomizable<IconSize>;
/**
* Sets a path to a custom SVG icon, used instead of the built-in icon library.
*/
source?: string;
};
export declare const PIcon: 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 icon — use `aria-label` to make the icon meaningful to screen readers when it conveys information.
*/
aria?: SelectedAriaAttributes<IconAriaAttribute>;
/**
* Sets the fill color of the icon using PDS color tokens.
* @default 'primary'
*/
color?: IconColor;
/**
* Selects an icon from the built-in PDS icon library by name (e.g. `arrow-right`, `close`).
* @default 'arrow-right'
*/
name?: IconName;
/**
* Sets the icon size using the PDS typographic scale. Use `inherit` to derive size from the parent element. Supports responsive breakpoint values.
* @default 'sm'
*/
size?: BreakpointCustomizable<IconSize>;
/**
* Sets a path to a custom SVG icon, used instead of the built-in icon library.
*/
source?: string;
} & import("react").RefAttributes<HTMLElement>>;