Link
A semantic anchor in six builds: inline links in running text, standalone module links, navigation, stretched titles and note references.
import { Link } from '@fairgarden/design/actions/link'
Links carry --primary12 text; the inline underline is the scope's --role-accent at 1.5 px. render swaps the element, for example render={<NextLink href="/trails" />}; these docs render every internal link that way.
Kinds
Kinds
inline (the default) underlines in running text. standalone is the caps module link with a trailing chevron. nav has no rest underline and marks the current page with aria-current="page" or data-active; on hover, bare navigation text (a bar item, a page number, a toolbar link) takes the accent underline. Add list for a link in a list (a navigation panel, footer or drawer): its hover changes only the ink, to --role-link-hover, and adds an underline only where that ink is the main ink. muted rests in --role-muted, as a breadcrumb's ancestors, with the same ink-only hover. external adds the arrow-open mark and "(external site)" for assistive technology.
Read the trail conditions before you set out.
See all trailsElevation data from the USGS (external site)(usgs.gov).
Primary and secondary
Primary and secondary
Without props a link inherits its scope's scales. secondary recolors the accent underline; primary recolors the text ink and focus ring.
On grounds
On paper, forest and leaf
The accent follows the ground: a non-text green on paper, a text-safe amber on forest, and the single ink on leaf.
On paper, find a preserve near you.
See all preservesOn forest, find a preserve near you.
See all preservesOn leaf, find a preserve near you.
See all preservesAPI Reference
A semantic anchor. render swaps the element, for example
render={<NextLink href="/trails" />}.
kind="inline"(default):--role-accentunderline in running text.kind="standalone": caps module link with a trailing ›.kind="nav": no rest underline; hover the bare-text underline; current viaaria-current="page"ordata-active.kind="title": stretched card or list-item title link [D157].kind="noteref"/kind="backref": note call and ↩ return, never underlined.index: the screen-only visited ✓ for long indexes [D174, D175].external: the arrow-open mark plus “(external site)” for assistive technology.list: withnav, the list link’s color-only hover (nav panels, footers, drawers).muted: the--role-mutedancestor ink with a color-only hover (breadcrumbs).
| Prop | Type | Description |
|---|---|---|
external | | Adds the arrow-open mark and “(external site)” for assistive technology.
Default |
index | | Adds the screen-only visited ✓ used in long indexes, such as reference
and archive lists. Default |
kind | | Which build: |
list | | With |
muted | | Rests in |
primary | | Primary Radix scale: the link text and focus ring. Never defaulted; omitted, it inherits the scope [D133]. |
secondary | | Secondary Radix scale: the accent underline. Never defaulted; omitted, it inherits the scope. |
className | | Extra class names, added after the module’s own. |
link
LinkKind
type LinkKind = 'nav' | 'title' | 'inline' | 'standalone' | 'backref' | 'noteref'<
'nav' | 'title' | 'inline' | 'standalone' | 'backref' | 'noteref' | null | undefined
>LinkProps
Props for Link: anchor props, render, and the kind, mark and color axes.
type LinkProps = {
/**
* Which build: `inline` (default) underlines in running text; `standalone`
* is the caps module link with a trailing ›; `nav` has no rest underline
* and marks the current page; `title` stretches over a card or list item;
* `noteref` and `backref` are the note call and return (§9.3).
*/
kind?: 'nav' | 'title' | 'inline' | 'standalone' | 'backref' | 'noteref' | null;
/**
* Adds the screen-only visited ✓ used in long indexes, such as reference
* and archive lists. Default `false` [D174, D175].
*/
index?: boolean | null;
/**
* Adds the arrow-open mark and "(external site)" for assistive technology.
* Default `false`.
*/
external?: boolean | null;
/**
* With `kind="nav"`: a list link (nav-panel, footer, drawer and breadcrumb
* lists), whose hover is `--role-link-hover` color only, plus the
* `--border-size-1-5` `--role-accent` underline where that ink is
* `--primary12`. Without it, `nav` is bare navigation text (bar and
* utility items, page numbers, toolbar links), whose hover is the
* `--border-size-2` `--role-accent` underline (§9.3) [D181]. Default
* `false`.
*/
list?: boolean | null;
/**
* Rests in `--role-muted` instead of `--primary12`, as a breadcrumb's
* ancestors. Hover takes `--role-link-hover` only (the underline is added
* where that ink is `--primary12`); with `kind="nav"` it replaces the bar
* item's bare-text underline (§9.3, §9.8) [D181]. Default `false`.
*/
muted?: boolean | null;
/**
* Primary Radix scale: the link text and focus ring. Never defaulted;
* omitted, it inherits the scope [D133].
*/
primary?:
| 'ruby'
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| null;
/**
* Secondary Radix scale: the accent underline. Never defaulted; omitted,
* it inherits the scope.
*/
secondary?:
| 'ruby'
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| 'amber'
| 'blue'
| 'cyan'
| 'grass'
| 'green'
| 'jade'
| 'lime'
| 'mint'
| 'orange'
| 'sky'
| 'teal'
| 'yellow'
| null;
/** Extra class names, added after the module's own. */
className?: string;
}LinkVariants
type LinkVariants = {
primary?:
| 'ruby'
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| null;
secondary?:
| 'ruby'
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| 'amber'
| 'blue'
| 'cyan'
| 'grass'
| 'green'
| 'jade'
| 'lime'
| 'mint'
| 'orange'
| 'sky'
| 'teal'
| 'yellow'
| null;
kind?: 'nav' | 'title' | 'inline' | 'standalone' | 'backref' | 'noteref' | null;
index?: boolean | null;
external?: boolean | null;
list?: boolean | null;
muted?: boolean | null;
}Specification: DESIGN-SYSTEM.md §9.3 (link) and §3.12 (links in running text).