Expandable
Expandable is progressive disclosure for a small amount of detail: the sub-fields of a parameter, an optional note, an aside a reader can open in place. Like Accordion it is built on the native <details> element, so it is keyboard-operable and screen-reader-correct with zero JavaScript. Where an accordion is a bordered card, an expandable is a light hairline, sized to nest.
Basic
<Expandable title="Advanced options">
These settings are optional...
</Expandable>Open by default
Pass defaultOpen to start expanded:
<Expandable title="Shown by default" defaultOpen>
...
</Expandable>Nesting
Because it is light, Expandable nests cleanly, for example under a field to reveal its sub-properties:
Props
| Prop | Type | Default | Effect |
|---|---|---|---|
title |
string | Show more |
The always-visible summary line |
defaultOpen |
boolean | false |
Start expanded (open is accepted too) |