Dashral Pro is hereSee pricing

Dashral

Page HeaderNew

The top of an admin page: breadcrumb, title, description, actions and tabs.

$ pnpm dlx shadcn@latest add @dashral/page-header

Invoices

Everything you've billed this year. Overdue invoices are reminded automatically.

Installation

$ pnpm dlx shadcn@latest add @dashral/page-header

Adds the component, the components it builds on, its npm packages and the theme tokens it uses. Or by its full URL: https://dashral.com/r/page-header.json

Usage

example.tsx
import { Button } from "@/components/dashral/button"
import { PageHeader } from "@/components/dashral/page-header"

<PageHeader
  breadcrumb={[{ label: "Billing", href: "/billing" }, { label: "Invoices" }]}
  title="Invoices"
  description="Everything you've billed this year."
  actions={<Button>New invoice</Button>}
/>

Using the npm package? Import from @dashral/ui/components/page-header instead, here and in the examples; the rest is the same.

Examples

A record's page

A back link, a badge beside the title, and a row of details.

INV-1048

Overdue
Fernpay Due

With tabs

Tabs under it; divided runs the line under them.

Settings

Manage your workspace and how your team works in it.

API reference

PageHeader

Also takes every prop of <header>(opens in a new tab).

PropTypeDefault
titleReactNode

The page's heading. Required.

—
descriptionReactNode

A line under the title.

—
titleAs"h1" | "h2"

The heading's level.

"h1"
breadcrumbBreadcrumbItem[]

The trail above the title, drawn with Breadcrumb.

—
back{ href, label }

A link back above the title, instead of a breadcrumb.

—
badgeReactNode

Beside the title, e.g. a status.

—
metaReactNode

A row of details under the title.

—
actionsReactNode

The page's buttons; on a phone they wrap under the title.

—
tabsReactNode

Under everything, e.g. Tabs with variant="line".

—
dividedboolean

A line under the header (under the tabs, with tabs).

false
size"sm" | "default"

sm for a panel or a settings section.

"default"
linkAsElementType

Your router's link, for the breadcrumb and the back link.

"a"
classNames{ title, description, meta, actions }

Classes for each part.

—
classNamestring

Extra classes, merged with cn() so yours win.

—

Accessibility

  • A <header> with a real heading (h1 by default): keep one h1 per page.
  • The breadcrumb is a navigation landmark; the back link's arrow is decoration.