Disclosure
Shows and hides extra content.
import { Disclosure } from '@/design-system';Examples
Everything in the plan, with no setup fee.
import { Disclosure } from '@/design-system';
export default function DisclosureBasic() {
return (
<Disclosure summary="What is included?">
<p>Everything in the plan, with no setup fee.</p>
</Disclosure>
);
}How it works
- It is a button with
aria-expanded, so Enter and Space work. - Hidden content stays in the page but is not shown or read.
Props
Disclosure takes only these props.
| Prop | Type | Default | Description |
|---|---|---|---|
summary | ReactNode | required | The button text. |
children | ReactNode | required | The content. |
defaultOpen | boolean | false | Starts open. |
className | string | — | Extra classes, for spacing or width. |