Example#
How long does a site take?
Two to four weeks.
Do I own the code?
Yes, from day one.
Usage#
Use a disclosure to hide detail that most readers can skip: an FAQ answer, the fine print of a plan, the long version of a step. It is the native details element, so it works without JavaScript and the browser's find-in-page opens a matching item.
Faqbuilds a list of disclosures fromitems, all closed at load; several may be open at once.faqJsonLd(items)returns the FAQPage JSON-LD for the page's head.- Exclusive groups. Give disclosures the same
nameand opening one closes the others. - Headings.
headingLevelwraps the summary in a heading, so the questions appear in the page outline. - Never hide what everyone needs, such as a price, a deadline or an error.
Anatomy#
How long does a site take?
Two to four weeks.
Do I own the code?
Yes, from day one.
- SummaryThe question, 56 px tall, row-title type.
.mk-disclosure-summary - GlyphA play triangle that turns 90° when open.
.mk-disclosure-glyph
Volume#
Reading layer: identical at every volume.
Quiet
How long does a site take?
Two to four weeks.Do I own the code?
Yes, from day one.Studio
How long does a site take?
Two to four weeks.Do I own the code?
Yes, from day one.Press
How long does a site take?
Two to four weeks.Do I own the code?
Yes, from day one.Rave
How long does a site take?
Two to four weeks.Do I own the code?
Yes, from day one.
Content#
- Write summaries as the question a reader would ask: "Do I own the code?"
- Answer in the first sentence, then explain: "Yes, from day one. The repository is yours…"
- Keep each answer short enough to read without scrolling; link out for more.
Do and don't#
Do
How long does a site take?
Two to four weeks.
Do I own the code?
Yes, from day one.
Don't
More info (open for pricing)
Accessibility#
- Native: Enter or Space opens the summary, find-in-page opens matching items, and it all works without JavaScript.
- The play glyph turns 90° on open; the height animates where the browser can and is instant under reduced motion.
| Keys | What happens |
|---|---|
| Tab | Moves to the summary row |
| EnterorSpace | Opens or closes the item |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-ink | --mk-paper | body | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink | --mk-paper | body-ui | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink | --mk-paper | long | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink | --mk-paper-sunken | body | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink | --mk-paper-sunken | body-ui | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink | --mk-paper-sunken | long | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink | --mk-paper-plate | body | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink | --mk-paper-plate | body-ui | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink | --mk-paper-plate | long | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink | --mk-paper-hover | body-ui | 17.99:1 · Lc 103.4, passes | 16.94:1 · Lc 96.5, passes |
--mk-ink | --mk-paper-sunken-hover | body-ui | 16.63:1 · Lc 98.0, passes | 16.46:1 · Lc 96.3, passes |
--mk-ink | --mk-paper-plate-hover | body-ui | 16.90:1 · Lc 99.1, passes | 16.02:1 · Lc 96.0, passes |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
summary required | ReactNode | none | The always-visible row. |
defaultOpen | boolean | none | |
name | string | none | An exclusive group: opening one closes the others with the same name. |
headingLevel | 2 | 3 | 4 | none | Wraps the summary text in `h2` to `h4`. |
children required | ReactNode | none |
Tokens#
System tokens (21)
--mk-border--mk-dur-disclosure--mk-ease-out--mk-focus--mk-font-text--mk-radius-control--mk-rule--mk-rule-soft--mk-space-3--mk-space-4--mk-space-5--mk-text--mk-type-body-leading--mk-type-body-size--mk-type-body-tracking--mk-type-body-weight--mk-type-row-title-leading--mk-type-row-title-size--mk-type-row-title-tracking--mk-type-row-title-weight--mk-width-prose
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.