datui
Color scheme

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 (h2 by default, titleAs to change). Inside a Panel the title labels the panel region.
  • The title has tabindex="-1"; View/Root move focus to it after navigation.
  • Preset buttons (Back, Close, Submit, Edit) have English accessible names you can localize with label props. Icon-only PanelHeaderButtons need aria-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.

PropTypeDefaultDescription
afterReactNode—End slot for actions.
beforeReactNode—Start slot, usually `PanelHeaderBack`.
classNamestring—
delimiter"none" | "separator" | "auto" | "spacing"autoWhat separates the header from the content. `auto`: a separator line in plain panels, spacing in card panels.
fixedbooleanfalseStick to the top while the panel scrolls.
floatbooleanfalseOverlay the content instead of taking space (e.g. over a cover image).
titleAs"h1" | "h2" | "h3"h2Heading element for the title.
transparentbooleanfalseNo background.

PanelHeaderButton

Icon and/or text button for the `before`/`after` slots of `PanelHeader`. Icon-only buttons need `aria-label`.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
asChildbooleanfalseMerge behavior and styles onto the single child element (e.g. a router link).
classNamestring—
disabledboolean—
hrefstring—
labelReactNode—Visible text next to (or instead of) the icon.
primarybooleanfalseAccent color and semibold label for the main action.
relstring—
targetstring—
type"button" | "submit" | "reset"—

PanelHeaderBack

Back button for `PanelHeader`. The chevron mirrors in right-to-left layouts.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
asChildboolean—Merge behavior and styles onto the single child element (e.g. a router link).
classNamestring—
disabledboolean—
hideOnDesktopbooleanfalseRender nothing on desktop layouts, where a side navigation handles going back.
hrefstring—
labelstringBackAccessible name, and visible text with `showLabel`.
primaryboolean—Accent color and semibold label for the main action.
relstring—
showLabelbooleanfalse
targetstring—
type"button" | "submit" | "reset"—

PanelHeaderClose

Close (×) button for `PanelHeader` and modal headers.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
asChildboolean—Merge behavior and styles onto the single child element (e.g. a router link).
classNamestring—
disabledboolean—
hrefstring—
labelstringCloseAccessible name.
primaryboolean—Accent color and semibold label for the main action.
relstring—
targetstring—
type"button" | "submit" | "reset"—

PanelHeaderSubmit

Confirm (✓) button for `PanelHeader`.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
asChildboolean—Merge behavior and styles onto the single child element (e.g. a router link).
classNamestring—
disabledboolean—
hrefstring—
labelstringDoneAccessible name.
primaryboolean—Accent color and semibold label for the main action.
relstring—
targetstring—
type"button" | "submit" | "reset"—

PanelHeaderEdit

Toggle between "edit" and "done" for `PanelHeader`. The consumer flips `isActive` in `onClick`.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
asChildboolean—Merge behavior and styles onto the single child element (e.g. a router link).
classNamestring—
disabledboolean—
doneLabelstringDone
editLabelstringEdit
hrefstring—
isActivebooleanfalseEdit mode is on: shows the "done" state.
primaryboolean—Accent color and semibold label for the main action.
relstring—
targetstring—
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`.

PropTypeDefaultDescription
asideReactNode—Content after the title, e.g. a dropdown chevron.
beforeReactNode—Avatar or icon before the title.
classNamestring—
subtitleReactNode—Secondary line under the title.