Surface & Panel
Composition

Surface & Panel

Named elevation treatments and the header/body/footer shell shared by panel-shaped components.

Surface

Surface is a Box pre-set to one of the library's named elevation treatments. An elevation prop sets background, border, radius, and shadow together from one named tier.

Surface props props
PropTypeDefaultDescription
elevation"sunken" | "flat" | "raised" | "overlay" | "dialog""flat"Elevation level. Sets background, border, radius, and shadow.
asElementType"div"Polymorphic element type.

Elevations

Sunken surface for input backgrounds, code blocks, and empty states.
Surface / sunken
Flat surface used by Card.
Surface / flat
Raised surface for nested cards and selected rows.
Surface / raised
Overlay surface for menus, popovers, and toasts.
Surface / overlay
Dialog surface for modal panels and drawers.
Surface / dialog

Each individual property is still an ordinary style prop, so you can override any part: <Surface elevation="overlay" rounded="lg"> overrides the elevation's default radius. Passing undefined explicitly keeps the elevation default.

Panel

Panel consists of three components: PanelHeader, PanelBody, and PanelFooter. Together they form the structured header/body/footer shell that Card, Modal, Drawer, PopoverPanel, and HoverCard all share.

PanelHeader props props
PropTypeDefaultDescription
childrenReactNode—The header title. Plain text or a Text component.
subReactNode—Secondary label beside or below the title.
subMonoboolean—Renders sub in a monospace font.
subPlacement"inline" | "block""inline"Place sub trailing the title or beneath it.
rightReactNode—Right-aligned slot: actions, counts, status.
onClose() => void—Renders a close button at the trailing edge.
density"compact" | "default" | "roomy""default"Controls inner padding.
size"md" | "lg""md"Larger title, for dialog-scale headers.
plainboolean—Removes the bottom border.
bandedboolean—Tinted background band.
Panel structure

Header variants

PanelHeader with sub
PanelHeader with right slot
PanelHeader / plain

PanelFooter

PanelFooter has a left prop for left-aligned content (like a step counter or record count) and places everything else on the right. Common patterns are action buttons, pagination, and status summaries.

PanelFooter props props
PropTypeDefaultDescription
leftReactNode—Left-aligned slot (step counter, record count). Everything else right-aligns.
density"compact" | "default" | "roomy""default"Controls inner padding.
plainboolean—Removes the top border.
bandedboolean—Tinted background band.
PanelFooter

Panel density

All three panel parts accept a density prop: "compact", "default", or "roomy". It controls the inner padding of each part, so a dense panel for a data-heavy dashboard and a roomy one for a settings dialog can use the same markup.

Panel / compact
Panel / roomy

Composing surfaces

Surface is the elevation base; Panel adds the header/body/footer structure. Together they form the pattern used by cards, dialogs, and flyouts in Onset.

Composed card