Example#
Usage#
Use the action dock on pages where the main action should stay in reach on a phone: a fixed bar at the bottom holding one full-width action key. It appears once the hero's key scrolls away and hides while another action key is mostly in view.
- Phones only. It shows below the md width; desktops already have the key in the navbar.
- The anchor. Mark the hero's key with
data-mk-dock-anchor; the dock waits until it leaves the screen. - Out of the way. It hides while a dialog or drawer is open and while the on-screen keyboard is up, and sets
--mk-dock-hso content and focus are never covered (WCAG 2.4.11). - Pages that should not have it simply do not render it.
Anatomy#
- Dock: a fixed bar at the bottom of the screen on the surface ink, with a soft top rule and the safe-area inset, below the md width only.
- Action key: one block key with the page's main verb, the same words as the hero's key.
The dock only prints on phone-width screens, so it is drawn here as a list; open this page on a phone and scroll past the example's key to see it.
Volume#
Reading layer: identical at every volume.
Content#
- One key, the same words as the hero's action: "Get a quote".
Do and don't#
Do
One dock with "Get a quote", the same words as the hero's key.
Don't
A dock with three keys: call, email and quote.
Accessibility#
- Hidden, it is
inert; shown, it sets--mk-dock-hso focused elements are never covered (2.4.11). - It hides while another action key is half visible, while a dialog or drawer is open and while the keyboard is up.
- Routes that must not show it simply do not render it.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
children required | ReactNode | none | One `block` action key. |
label | string | "Quick action" | The dock's region name (default "Quick action"). |
className | string | none |
Tokens#
System tokens (9)
--mk-border--mk-dur-reduced--mk-ease-out--mk-rule-soft--mk-space-3--mk-space-4--mk-surface--mk-text--mk-z-dock
Its own properties (1)
--mk-dock-h
Changelog#
Arrived in 0.1.0.
Sectionwith its plate andArtslot,Plate,VolumeScope,PageHero,SectionHead,Eyebrow,Card,LineCard,InfoPanel,Stack,Cluster,Grid,Container,Main,Ruleand theFittedLineclient fitter;Navbarwith theNavDisclosuremega panels,Footer,FooterMap,BuildStamp,SkipLink,ActionDockandVisitorControls; theTableparts,ComparisonTablewith the one-tier switcher,SpecStrip,Numeral,Stat,StatGroup,StatusChip,BadgeandScoreDial;ProsewithmdxComponents,Quote,CodeBlockwithCopyButton,Figure,ScreenshotFrameandPhoneFrame; and the brand: the three evolved 2 × 2 options inmarkGeometry(a Overprint by default, b Paper seam, c Key block) with the pixel-snappedpxmode and the one-ink seam variant,logoGeometrywith the 1x clear-space frame,Mark,Wordmark,Logo,MaxosMarkandLineBadge. Read the whole entry