Example#
Read the Fernlight case study, then visit Pebblepath (opens in a new tab).
Usage#
Use a link to go somewhere: another page, a section, a file, another site. Doing something on this page is a Button.
inline(default) sits in running text and is always underlined, so it never depends on colour.standalonestands on its own line, such as "Read the case study", in the control weight with a trailing arrow; the underline appears on hover and focus.quietprints in the text ink, underlined, for footers and legal lines where many links sit together.- Other sites get an arrow up and to the right automatically. With
target="_blank", the link adds "(opens in a new tab)" for screen readers andrel="noopener". - The current page takes
current, which setsaria-current="page".
Anatomy#
Read the Fernlight case study, then visit Pebblepath (opens in a new tab).
- Link textUnderlined in the link ink, 2 px or 0.08 em thick.
.mk-link - GlyphThe arrow for other sites and standalone links.
.mk-link-glyph
Volume#
Reading layer: links read the same at every volume. Only the art around the paragraph changes.
Quiet
Read the Fernlight case study, then visit Pebblepath (opens in a new tab).
Studio
Read the Fernlight case study, then visit Pebblepath (opens in a new tab).
Press
Read the Fernlight case study, then visit Pebblepath (opens in a new tab).
Rave
Read the Fernlight case study, then visit Pebblepath (opens in a new tab).
Content#
- The words say where the link goes: "Read the Fernlight case study", not "Click here" or "Learn more".
- Link the words that name the destination, not a whole sentence.
- Never put two links with the same words and different destinations on one page.
Do and don't#
Do
Pebblepath rebuilt the menu. Read the Fernlight case study.
Don't
Pebblepath rebuilt the menu. To read the case study, click here.
Accessibility#
- The underline is the affordance on inline links; standalone links are told apart by weight and the arrow, so nothing depends on colour.
- Absolute URLs get the external arrow; with
target="_blank"a hidden "(opens in a new tab)" joins the name andrel="noopener"is set. currentsetsaria-current="page". Visited links keep the unvisited colour.
| Keys | What happens |
|---|---|
| Tab | Moves focus to the link |
| Enter | Follows the link |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-ink-m-text | --mk-paper | body-ui | 8.62:1 · Lc 82.5, passes | 13.43:1 · Lc 83.5, passes |
--mk-ink-m-text | --mk-paper-plate | body-ui | 9.63:1 · Lc 90.1, passes | 12.45:1 · Lc 82.7, passes |
--mk-ink-a-text | --mk-paper | body-ui | 8.09:1 · Lc 82.7, passes | 13.41:1 · Lc 83.5, passes |
--mk-ink-a-text | --mk-paper-plate | body-ui | 9.04:1 · Lc 90.3, passes | 12.42:1 · Lc 82.7, passes |
--mk-ink-r-text | --mk-paper | body-ui | 8.20:1 · Lc 82.6, passes | 13.38:1 · Lc 83.3, passes |
--mk-ink-r-text | --mk-paper-plate | body-ui | 9.16:1 · Lc 90.2, passes | 12.40:1 · Lc 82.5, passes |
--mk-ink-k-text | --mk-paper | body-ui | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink-k-text | --mk-paper-plate | body-ui | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink-wood-text | --mk-paper | body-ui | 7.97:1 · Lc 82.6, passes | 13.38:1 · Lc 83.3, passes |
--mk-ink-wood-text | --mk-paper-plate | body-ui | 8.90:1 · Lc 90.2, passes | 12.40:1 · Lc 82.5, passes |
--mk-ink-go-text | --mk-paper | body-ui | 8.14:1 · Lc 82.8, passes | 13.38:1 · Lc 83.7, passes |
--mk-ink-go-text | --mk-paper-plate | body-ui | 9.10:1 · Lc 90.4, passes | 12.40:1 · Lc 83.0, passes |
--mk-ink-m-text | --mk-paper-sunken | meta | 7.95:1 · Lc 77.2, passes | 12.87:1 · Lc 83.1, passes |
--mk-ink-m-text | --mk-ink-m-tint | meta | 7.95:1 · Lc 77.2, passes | 11.43:1 · Lc 81.6, passes |
--mk-ink-a-text | --mk-paper-sunken | meta | 7.46:1 · Lc 77.4, passes | 12.84:1 · Lc 83.0, passes |
--mk-ink-a-text | --mk-ink-a-tint | meta | 7.66:1 · Lc 79.1, passes | 11.15:1 · Lc 81.2, passes |
--mk-ink-r-text | --mk-paper-sunken | meta | 7.56:1 · Lc 77.3, passes | 12.82:1 · Lc 82.9, passes |
--mk-ink-r-text | --mk-ink-r-tint | meta | 7.62:1 · Lc 77.9, passes | 11.34:1 · Lc 81.3, passes |
--mk-ink-k-text | --mk-paper-sunken | meta | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink-k-text | --mk-ink-k-tint | meta | 15.38:1 · Lc 92.9, passes | 13.59:1 · Lc 94.2, passes |
--mk-ink-wood-text | --mk-paper-sunken | meta | 7.35:1 · Lc 77.3, passes | 12.82:1 · Lc 82.9, passes |
--mk-ink-wood-text | --mk-ink-wood-tint | meta | 7.45:1 · Lc 78.2, passes | 11.31:1 · Lc 81.3, passes |
--mk-ink-go-text | --mk-paper-sunken | meta | 7.51:1 · Lc 77.5, passes | 12.82:1 · Lc 83.3, passes |
--mk-ink-go-text | --mk-ink-go-tint | meta | 7.73:1 · Lc 79.4, passes | 11.05:1 · Lc 81.5, passes |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
href required | string | none | |
variant | LinkVariant | none | |
external | boolean | none | Auto for absolute URLs: the `arrow-up-right` glyph, and with `target="_blank"` a hidden note. |
current | boolean | none | `aria-current="page"`. |
newTabLabel | string | none | The hidden note for `target="_blank"` (literal copy, D-I2). |
render | RenderProp | none | |
children required | ReactNode | none |
Tokens#
System tokens (13)
--mk-border--mk-dur-hover--mk-ease-out--mk-focus--mk-font-text--mk-link--mk-space-2--mk-target-min--mk-text--mk-type-control-md-size--mk-type-control-md-tracking--mk-type-control-md-weight--mk-type-row-title-leading
Its own properties (1)
--mk-link-glyph-gap
Changelog#
Arrived in 0.1.0.
- The reading layer's controls, overlays, forms and visitor prefs (P2-T1 to P2-T5): every Button is the comic hit key, with IconButton, Link and Tooltip; Input, Textarea, Select, Checkbox and CheckboxGroup, Radio and RadioGroup, Switch, Slider with the ruler, RulerReadout and SegmentedControl; Dialog, Drawer, NavSheet, Tabs, Disclosure, Faq and faqJsonLd on Base UI 1.9 where the platform falls short; Field, Fieldset, Form with the site's inline validation, ErrorSummary, Callout, Honeypot, FormTimestamp and QuoteForm; PrefsScript under 1 KB, usePref and setPref with cross-tab sync, ThemeToggle and the visitor VolumeDial; VisuallyHidden.