import React from 'react'; import type { Emphasis, Size } from '../../util/variant-types'; import { type SemanticIconName } from '../Icon'; export type LinkProps = React.AnchorHTMLAttributes & { /** * Component used to render the element. Meant to support interaction with framework navigation libraries. * * **Default is `"a"`**. */ as?: string | React.ElementType; /** * The link contents or label. Using ReactNode to support customized text treatments */ children: React.ReactNode; /** * Where `Link` sits alongside other text and content: * * * **inline** - Inline link inherits the text size/color established within the `

` or other tag they are embedded in. * * **standalone** - Users can choose from the available sizes, select variants, and add a trailing icon. * * **Default is `"inline"`**. * * ---- * * **Note**: This will only apply when `"standalone"` is used */ context?: 'inline' | 'standalone'; /** * The role of the trailing icon on the link (when `context` is `"standalone"`) * * This names which of two roles the link is filling rather than picking a glyph: * `"open-in-new"` marks a link that leaves the site, and `"forward"` a low-emphasis * link that carries the reader onward. Both glyphs come from `IconProvider`, so an app * changes either one everywhere at once. */ icon?: Extract; /** * Extra or lowered colors added to a link */ emphasis?: Emphasis | 'default'; /** * Whether to render the link text at bold weight. Applies in both contexts, and holds * across every emphasis, variant, and state. * * **Default is `false`**. */ isBold?: boolean; /** * The size of the link (when its context is `"standalone"`). * * ---- * * **Note**: This will only apply when `"standalone"` is used */ size?: Extract; /** * The variant treatment for **standalone** links (use "inverse" on dark backgrounds). * * **Default is `"default"`**. * * ---- * * **Note**: This will only apply when `"standalone"` is used */ variant?: 'default' | 'inverse'; } & ExtendedElement; /** * ## Usage * * | Type/Use | Description | Example | * |----------|-------------|---------| * | Inline | Embedded in body text, styled with an underline. | Reference external docs, "Learn more" links, citing sources. | * | Standalone | Appears on its own, often in navs or action areas. | Footer links, header navigation, CTA-style links (when not using a button). | * | External | Opens to a different domain or website; often includes an icon or notice. | Links to external sites, third-party tools, privacy policy or support articles. | * | Internal navigation | Navigates within the app or website (SPA routing or anchor-based). | Page-to-page navigation, in-page jump links. | * | Breadcrumb | Represents a step in a navigation trail. | Hierarchical navigation, backtracking in nested pages. | * | Disabled | Styled like a link but non-interactive. | Unavailable destinations, permission-based restrictions. | * * ### Best Practices * * * **Do** use links primarily to support navigation, directing users to another page or a different portion of the same page. * * **Don't** use links as actions that change data or state, or that trigger a high-emphasis action; use `Button` instead. * * **Do** display the external ("open-in-new") icon when the link text needs support to convey an external domain. * * **Don't** use other icons to represent an external link. * * **Do** display an underline on inline links to reinforce interactivity and accessibility. * * **Don't** use the low emphasis variant in inline contexts, as it can fail to convey interactivity. * * ## Content & Accessibility * * ### Do's * * * Use a meaningful, descriptive label that clearly indicates the link's destination. * * Make sure the link reflects the content people will find at the destination. * * Use "Learn more" for links to more information, ensuring the preceding content provides context. * * ### Don'ts * * * Don't use generic phrases like "click here". * * Don't include leading spaces or end punctuation within the link. * * Don't use the same link text for different destinations on the same page. * * Don't use excessively long link text. */ export declare const Link: React.ForwardRefExoticComponent & { /** * Component used to render the element. Meant to support interaction with framework navigation libraries. * * **Default is `"a"`**. */ as?: string | React.ElementType; /** * The link contents or label. Using ReactNode to support customized text treatments */ children: React.ReactNode; /** * Where `Link` sits alongside other text and content: * * * **inline** - Inline link inherits the text size/color established within the `

` or other tag they are embedded in. * * **standalone** - Users can choose from the available sizes, select variants, and add a trailing icon. * * **Default is `"inline"`**. * * ---- * * **Note**: This will only apply when `"standalone"` is used */ context?: "inline" | "standalone"; /** * The role of the trailing icon on the link (when `context` is `"standalone"`) * * This names which of two roles the link is filling rather than picking a glyph: * `"open-in-new"` marks a link that leaves the site, and `"forward"` a low-emphasis * link that carries the reader onward. Both glyphs come from `IconProvider`, so an app * changes either one everywhere at once. */ icon?: Extract; /** * Extra or lowered colors added to a link */ emphasis?: Emphasis | "default"; /** * Whether to render the link text at bold weight. Applies in both contexts, and holds * across every emphasis, variant, and state. * * **Default is `false`**. */ isBold?: boolean; /** * The size of the link (when its context is `"standalone"`). * * ---- * * **Note**: This will only apply when `"standalone"` is used */ size?: Extract; /** * The variant treatment for **standalone** links (use "inverse" on dark backgrounds). * * **Default is `"default"`**. * * ---- * * **Note**: This will only apply when `"standalone"` is used */ variant?: "default" | "inverse"; } & React.RefAttributes>;