Navigation
PanelHeader
Top bar of a Panel: a title plus before/after slots for preset buttons.
import { PanelHeader, PanelHeaderButton, PanelHeaderBack, PanelHeaderClose, PanelHeaderSubmit, PanelHeaderEdit, PanelHeaderContent } from "datui";Playground
Settings
<PanelHeader delimiter="auto" titleAs="h2">Settings</PanelHeader>Examples
Slots and presets
Contacts
New contact
Profile
Edit toggle
PanelHeaderEdit switches icon, label and aria-pressed with isActive.
List
Rich title
PanelHeaderContent adds an avatar, subtitle and aside; with onClick it is a button.
AKAnna Kovácsonline
Accessibility
- Renders
<header>with the title as a heading (h2by default,titleAsto change). Inside aPanelthe title labels the panel region. - The title has
tabindex="-1";View/Rootmove focus to it after navigation. - Preset buttons (
Back,Close,Submit,Edit) have English accessible names you can localize withlabelprops. Icon-onlyPanelHeaderButtons needaria-label. PanelHeaderBack's chevron mirrors in right-to-left layouts.- Title is centered on compact widths and start-aligned from tablet width;
delimiter="auto"draws a line in plain panels and spacing in card panels.
API
PanelHeader
Top bar of a `Panel`: title plus `before`/`after` slots. The title labels the panel and receives focus after navigation.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | — | End slot for actions. |
| before | ReactNode | — | Start slot, usually `PanelHeaderBack`. |
| className | string | — | |
| delimiter | "none" | "separator" | "auto" | "spacing" | auto | What separates the header from the content. `auto`: a separator line in plain panels, spacing in card panels. |
| fixed | boolean | false | Stick to the top while the panel scrolls. |
| float | boolean | false | Overlay the content instead of taking space (e.g. over a cover image). |
| titleAs | "h1" | "h2" | "h3" | h2 | Heading element for the title. |
| transparent | boolean | false | No background. |
PanelHeaderButton
Icon and/or text button for the `before`/`after` slots of `PanelHeader`. Icon-only buttons need `aria-label`.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| asChild | boolean | false | Merge behavior and styles onto the single child element (e.g. a router link). |
| className | string | — | |
| disabled | boolean | — | |
| href | string | — | |
| label | ReactNode | — | Visible text next to (or instead of) the icon. |
| primary | boolean | false | Accent color and semibold label for the main action. |
| rel | string | — | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |
PanelHeaderBack
Back button for `PanelHeader`. The chevron mirrors in right-to-left layouts.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| asChild | boolean | — | Merge behavior and styles onto the single child element (e.g. a router link). |
| className | string | — | |
| disabled | boolean | — | |
| hideOnDesktop | boolean | false | Render nothing on desktop layouts, where a side navigation handles going back. |
| href | string | — | |
| label | string | Back | Accessible name, and visible text with `showLabel`. |
| primary | boolean | — | Accent color and semibold label for the main action. |
| rel | string | — | |
| showLabel | boolean | false | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |
PanelHeaderClose
Close (×) button for `PanelHeader` and modal headers.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| asChild | boolean | — | Merge behavior and styles onto the single child element (e.g. a router link). |
| className | string | — | |
| disabled | boolean | — | |
| href | string | — | |
| label | string | Close | Accessible name. |
| primary | boolean | — | Accent color and semibold label for the main action. |
| rel | string | — | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |
PanelHeaderSubmit
Confirm (✓) button for `PanelHeader`.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| asChild | boolean | — | Merge behavior and styles onto the single child element (e.g. a router link). |
| className | string | — | |
| disabled | boolean | — | |
| href | string | — | |
| label | string | Done | Accessible name. |
| primary | boolean | — | Accent color and semibold label for the main action. |
| rel | string | — | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |
PanelHeaderEdit
Toggle between "edit" and "done" for `PanelHeader`. The consumer flips `isActive` in `onClick`.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| asChild | boolean | — | Merge behavior and styles onto the single child element (e.g. a router link). |
| className | string | — | |
| disabled | boolean | — | |
| doneLabel | string | Done | |
| editLabel | string | Edit | |
| href | string | — | |
| isActive | boolean | false | Edit mode is on: shows the "done" state. |
| primary | boolean | — | Accent color and semibold label for the main action. |
| rel | string | — | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |
PanelHeaderContent
Rich title for `PanelHeader`. With `onClick` it becomes a button — pair it with `PanelHeaderContext` and pass `aria-expanded`/`aria-controls`.
| Prop | Type | Default | Description |
|---|---|---|---|
| aside | ReactNode | — | Content after the title, e.g. a dropdown chevron. |
| before | ReactNode | — | Avatar or icon before the title. |
| className | string | — | |
| subtitle | ReactNode | — | Secondary line under the title. |