PANEL
Source: design-system/, styled by design-system/. React Server Component, zero client JavaScript.
Props
| Prop | Type | Default | Required |
|---|---|---|---|
Proptitle | Typestring | Defaultnone | Requiredyes |
Propmarker | Typestring | Defaultnone | Requiredyes |
Propas | Type'div' | 'section' | 'aside' | Default'div' | Requiredno |
ProptitleId | Typestring | Defaultnone | Requiredno |
Propreveal | Typeboolean | Defaultfalse | Requiredno |
Propaction | TypeReactNode | Defaultnone | Requiredno |
Other div attributes pass through to the root.
Examples
whoami
Body content.
SOURCE
<Panel className="w-full" marker="[+]" title="whoami"><p className="m-0 p-4">Body content.</p></Panel>
<Panel className="w-full" as="aside" marker="[~]" title="status" titleId="panel-demo-title" action={<a href="#panel">link</a>}><p className="m-0 p-4">Landmark panel with an action.</p></Panel>A bordered frame on a carbon-950 surface with a faint top glow and a 2px corner radius. The header holds a decorative marker (aria-hidden), the title as an h3 and an optional action node after it. as picks the root element; titleId becomes the heading id and the root's aria-labelledby, which names a section or aside landmark by its title. The panel is its own inline-size container, so it must be a block-level, full-width element in its parent. Below 24rem the header tightens its padding and letter spacing.
Reveal coupling
reveal only sets data-type-reveal on the heading and suppressHydrationWarning, because the heading text is rewritten after hydration. The scroll typing itself comes from the app-wide TypeReveal island mounted by GlobalMotion in the root layout, which observes every [ element. Without that island the attribute has no effect.
Styling
The frame rules live in design-system/. A section that needs a different title size or header layout scopes the change under its own class in its own stylesheet and selects . and ..
Accessibility
The title is the heading, so give each landmark panel its own titleId.