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.

139 lines (138 loc) 5.31 kB
import type { BaseProps } from '../../BaseProps'; import type { BreakpointCustomizable, LinkPureAlignLabel, SelectedAriaAttributes, LinkPureAriaAttribute, LinkPureColor, LinkPureIcon, LinkPureSize, LinkPureTarget } from '../types'; export type PLinkPureProps = BaseProps & { /** * Visually marks the link as the currently active navigation item, e.g. the current page. * @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<LinkPureAlignLabel>; /** * Sets ARIA attributes on the link element to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<LinkPureAriaAttribute>; /** * Sets the foreground color of the link's icon and label text. * @default 'primary' */ color?: LinkPureColor; /** * Sets the native `download` attribute to trigger a file download. Only applies when `href` is set. */ download?: string; /** * Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. * @default false */ hideLabel?: BreakpointCustomizable<boolean>; /** * When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element. */ href?: string; /** * Sets the icon displayed next to the label. * @default 'arrow-right' */ icon?: LinkPureIcon; /** * Sets a path to a custom SVG icon, used instead of the built-in icon set. */ iconSource?: string; /** * Sets the `rel` attribute on the link (e.g. `noopener`). Only applies when `href` is set. */ rel?: string; /** * Sets the font size of the link label. Supports responsive breakpoint values. * @default 'sm' */ size?: BreakpointCustomizable<LinkPureSize>; /** * Expands the space between icon and label to fill the full container width. Supports responsive breakpoint values. * @default false */ stretch?: BreakpointCustomizable<boolean>; /** * Specifies where to open the linked URL (e.g. `_self`, `_blank`). Only applies when `href` is set. * @default '_self' */ target?: LinkPureTarget; /** * Adds a text underline to the label to reinforce its link-like appearance. * @default false */ underline?: boolean; }; export declare const PLinkPure: 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 link as the currently active navigation item, e.g. the current page. * @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<LinkPureAlignLabel>; /** * Sets ARIA attributes on the link element to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<LinkPureAriaAttribute>; /** * Sets the foreground color of the link's icon and label text. * @default 'primary' */ color?: LinkPureColor; /** * Sets the native `download` attribute to trigger a file download. Only applies when `href` is set. */ download?: string; /** * Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. * @default false */ hideLabel?: BreakpointCustomizable<boolean>; /** * When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element. */ href?: string; /** * Sets the icon displayed next to the label. * @default 'arrow-right' */ icon?: LinkPureIcon; /** * Sets a path to a custom SVG icon, used instead of the built-in icon set. */ iconSource?: string; /** * Sets the `rel` attribute on the link (e.g. `noopener`). Only applies when `href` is set. */ rel?: string; /** * Sets the font size of the link label. Supports responsive breakpoint values. * @default 'sm' */ size?: BreakpointCustomizable<LinkPureSize>; /** * Expands the space between icon and label to fill the full container width. Supports responsive breakpoint values. * @default false */ stretch?: BreakpointCustomizable<boolean>; /** * Specifies where to open the linked URL (e.g. `_self`, `_blank`). Only applies when `href` is set. * @default '_self' */ target?: LinkPureTarget; /** * Adds a text underline to the label to reinforce its link-like appearance. * @default false */ underline?: boolean; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;