Example#
Usage#
Use a button for an action that happens on this page: send a form, open a dialog, start something. Going to another page is a link; use href on a button only when the destination is the page's main action, such as "Get a quote".
- One action key per view.
actionprints in the yellow key ink, the only yellow on the page (D-C1). Everything else issecondary(the default),primaryfor a firm second choice,quietbeside a stronger key, orlinkfor an action that reads as text. - Line keys.
variant="line"withlinefills the face with a line's plate, for actions that belong to one line of work, such as "See the websites". - Destructive actions use
primarywith a glyph and an explicit verb ("Delete the draft"). There is no red button: every Process ink already means a line of work (D-C2). - Pending and toggles.
loadingkeeps the key focusable, blocks a second submit and draws a bar under the label.pressedmakes a toggle key that holds at half travel. - Sizes.
sm40 px,md48 px (default),lg56 px; on touch screens nothing goes under 44 px.block="phone"stretches the key below the md width.
Anatomy#
- Key faceThe face, the 3 px ink rule and the hard offset, which a press closes.
.mk-button - Start glyphOptional, from the shape alphabet; hidden from assistive tech.
.mk-button-start - LabelA literal verb in the control role.
.mk-button-label - End glyphOptional; an arrow when the key goes somewhere.
.mk-button-end
Volume#
The key is reading layer, so it prints the same at every volume and in every comic register (D-B2, D-N9): the face, the rule and the offset never change. The art around it is what gets louder.
Quiet
Studio
Press
Rave
Content#
- Start with a verb and say what happens: "Send", "Get a quote", "Email it instead". The joke goes next to the key, never on it (D-I2).
- Sentence case, one to four words. Labels never wrap mid-word; a full-width key balances its lines.
- The same action keeps the same label everywhere it appears, so "Get a quote" is never also "Request pricing".
- No "Click here", "Submit" or "OK": a reader who lands on the key alone should know what it does.
Do and don't#
Do
Don't
Do
Don't
Accessibility#
- A native
button(type="button"by default) or, withhref, a link; labels are literal verbs. - Pending (
loading) keeps the key focusable witharia-busyandaria-disabled, blocks a second submit and draws a bar under the label; under reduced motion the bar becomes a static ellipsis. - A toggle key (
pressed) exposesaria-pressedand sits at half travel, so its state does not depend on colour. - Keys are 40, 48 and 56 px tall and never under 44 px on touch screens; the focus ring is 2 px in
--mk-focuswith a 2 px gap.
| Keys | What happens |
|---|---|
| Tab | Moves focus to the key; a pending key stays focusable |
| Enter | Activates the key (a link-rendered key follows its link) |
| Space | Activates a button key; a toggle key flips aria-pressed |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-ink-disabled | --mk-paper | ui | 3.27:1 · Lc 56.5, passes | 6.53:1 · Lc 46.1, passes |
--mk-ink-disabled | --mk-paper-sunken | ui | 3.01:1 · Lc 51.2, passes | 6.25:1 · Lc 45.7, passes |
--mk-ink-disabled | --mk-paper-plate | ui | 3.65:1 · Lc 64.1, passes | 6.05:1 · Lc 45.4, passes |
--mk-on-m | --mk-ink-m-solid | control-sm | 5.31:1 · Lc 79.9, passes | 4.53:1 · Lc 67.8, passes |
--mk-on-m | --mk-ink-m-hover | control-sm | 6.06:1 · Lc 83.1, passes | 5.10:1 · Lc 71.2, passes |
--mk-on-a | --mk-ink-a-solid | control-sm | 8.36:1 · Lc 60.1, passes | 10.43:1 · Lc 70.0, passes |
--mk-on-a | --mk-ink-a-hover | control-sm | 9.30:1 · Lc 65.2, passes | 11.51:1 · Lc 75.1, passes |
--mk-on-r | --mk-ink-r-solid | control-sm | 4.51:1 · Lc 75.7, passes | 8.53:1 · Lc 60.1, passes |
--mk-on-r | --mk-ink-r-hover | control-sm | 5.10:1 · Lc 79.6, passes | 9.56:1 · Lc 65.4, passes |
--mk-on-k | --mk-ink-k-solid | control-sm | 18.42:1 · Lc 107.1, passes | 16.21:1 · Lc 95.1, passes |
--mk-on-k | --mk-ink-k-hover | control-sm | 19.43:1 · Lc 107.6, passes | 17.71:1 · Lc 101.1, passes |
--mk-on-y | --mk-ink-y-solid | control-sm | 14.44:1 · Lc 89.2, passes | 14.76:1 · Lc 89.4, passes |
--mk-on-y | --mk-ink-y-hover | control-sm | 15.85:1 · Lc 94.9, passes | 16.20:1 · Lc 95.2, passes |
--mk-on-wood | --mk-ink-wood-solid | control-sm | 9.31:1 · Lc 64.8, passes | 4.54:1 · Lc 70.2, passes |
--mk-on-wood | --mk-ink-wood-hover | control-sm | 10.35:1 · Lc 70.1, passes | 5.18:1 · Lc 73.9, passes |
--mk-on-go | --mk-ink-go-solid | control-sm | 4.54:1 · Lc 76.3, passes | 10.08:1 · Lc 68.6, passes |
--mk-on-go | --mk-ink-go-hover | control-sm | 5.15:1 · Lc 80.3, passes | 11.15:1 · Lc 73.7, passes |
--mk-on-lead | --mk-ink-lead-solid | control-sm | 5.31:1 · Lc 79.9, passes | 4.53:1 · Lc 67.8, passes |
--mk-on-lead | --mk-ink-lead-hover | control-sm | 6.06:1 · Lc 83.1, passes | 5.10:1 · Lc 71.2, passes |
--mk-on-support | --mk-ink-support-solid | control-sm | 8.36:1 · Lc 60.1, passes | 10.43:1 · Lc 70.0, passes |
--mk-on-support | --mk-ink-support-hover | control-sm | 9.30:1 · Lc 65.2, passes | 11.51:1 · Lc 75.1, passes |
--mk-on-spot | --mk-ink-spot-solid | control-sm | 14.44:1 · Lc 89.2, passes | 14.76:1 · Lc 89.4, passes |
--mk-on-spot | --mk-ink-spot-hover | control-sm | 15.85:1 · Lc 94.9, passes | 16.20:1 · Lc 95.2, passes |
--mk-on-action | --mk-action | control-sm | 14.44:1 · Lc 89.2, passes | 14.76:1 · Lc 89.4, passes |
--mk-on-action | --mk-action-hover | control-sm | 15.85:1 · Lc 94.9, passes | 16.20:1 · Lc 95.2, passes |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
variant | ButtonVariant | none | |
size | Size | none | |
line | "custom-apps" | "growth" | "maxos" | "software" | "websites" | none | The line a `variant="line"` key prints in (D-C2). |
block | "phone" | boolean | none | Full width always, or below the md width (48rem). |
loading | boolean | none | `aria-busy` and `aria-disabled`; stays focusable; the label stays. |
pressed | boolean | none | A toggle key (`aria-pressed`). |
href | string | none | Renders `<a>`; Next.js routing uses `render`. |
render | RenderProp | none | |
iconStart | ReactNode | none | |
iconEnd | ReactNode | none | |
children required | ReactNode | none | A literal verb (D-I2 floor). Icon-only actions use `IconButton`. |
Tokens#
System tokens (43)
--mk-action--mk-action-edge--mk-border--mk-border-thick--mk-control-h-lg--mk-control-h-md--mk-control-h-sm--mk-disabled--mk-dur-hover--mk-dur-key-sink--mk-dur-reduced--mk-ease-out--mk-focus--mk-font-text--mk-hover--mk-line-plate--mk-link--mk-on-action--mk-on-line-plate--mk-on-selected--mk-on-slab--mk-radius-control--mk-rule--mk-selected--mk-shadow-key--mk-slab--mk-space-2--mk-space-6--mk-surface-raised--mk-target-min--mk-target-touch--mk-text--mk-text-disabled--mk-type-control-lg-leading--mk-type-control-lg-size--mk-type-control-lg-tracking--mk-type-control-md-leading--mk-type-control-md-size--mk-type-control-md-tracking--mk-type-control-md-weight--mk-type-control-sm-leading--mk-type-control-sm-size--mk-type-control-sm-tracking
Its own properties (12)
--mk-button-gap--mk-button-glyph--mk-button-h--mk-button-leading--mk-button-pad--mk-button-size--mk-button-tracking--mk-key-edge--mk-key-face--mk-key-label--mk-key-offset--mk-key-rule
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.