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.

99 lines (98 loc) 3.87 kB
import type { BaseProps } from '../../BaseProps'; import type { SelectedAriaAttributes, LinkAriaAttribute, BreakpointCustomizable, LinkIcon, LinkTarget, LinkVariant } from '../types'; export type PLinkProps = BaseProps & { /** * Sets ARIA attributes on the link element to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<LinkAriaAttribute>; /** * Reduces the link's padding and height for denser layouts. Supports responsive breakpoint values. * @default false */ compact?: BreakpointCustomizable<boolean>; /** * 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 link label. Use `none` to show no icon. * @default 'none' */ icon?: LinkIcon; /** * 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; /** * Specifies where to open the linked URL (e.g. `_self`, `_blank`). Only applies when `href` is set. * @default '_self' */ target?: LinkTarget; /** * Sets the visual style variant of the link (e.g. `primary`, `secondary`, `tertiary`). * @default 'primary' */ variant?: LinkVariant; }; export declare const PLink: 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 link element to improve accessibility for screen readers. */ aria?: SelectedAriaAttributes<LinkAriaAttribute>; /** * Reduces the link's padding and height for denser layouts. Supports responsive breakpoint values. * @default false */ compact?: BreakpointCustomizable<boolean>; /** * 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 link label. Use `none` to show no icon. * @default 'none' */ icon?: LinkIcon; /** * 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; /** * Specifies where to open the linked URL (e.g. `_self`, `_blank`). Only applies when `href` is set. * @default '_self' */ target?: LinkTarget; /** * Sets the visual style variant of the link (e.g. `primary`, `secondary`, `tertiary`). * @default 'primary' */ variant?: LinkVariant; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;