Header Toolbar
List-page toolbar: title with count and New button, then a search field, removable key/value filter chips, an Add filter button and a list/board view toggle.
minimal/layout/header-toolbarSource
"use client";
import { useState } from "react";
import { LayoutGrid, List, ListFilter, Plus, Search, X } from "lucide-react";
import { cn } from "@/lib/utils";
export interface HeaderToolbarFilter {
id: string;
label: string;
value: string;
}
export interface HeaderToolbarProps {
title?: string;
count?: number;
filters?: HeaderToolbarFilter[];
onFiltersChange?: (filters: HeaderToolbarFilter[]) => void;
query?: string;
onQueryChange?: (q: string) => void;
view?: "list" | "board";
onViewChange?: (view: "list" | "board") => void;
primaryLabel?: string;
onPrimary?: () => void;
className?: string;
}
/** List-page toolbar: title + count and New button, then search, removable filter chips, “Add filter” and a list/board toggle. */
export function HeaderToolbar({
title = "Incidents",
count = 128,
filters: initialFilters = [
{ id: "status", label: "Status", value: "Open" },
{ id: "team", label: "Team", value: "Payments" },
],
onFiltersChange,
query: controlledQuery,
onQueryChange,
view: controlledView,
onViewChange,
primaryLabel = "New incident",
onPrimary,
className,
}: HeaderToolbarProps) {
const [filters, setFilters] = useState(initialFilters);
const [innerQuery, setInnerQuery] = useState("");
const [innerView, setInnerView] = useState<"list" | "board">("list");
const query = controlledQuery ?? innerQuery;
const view = controlledView ?? innerView;
const removeFilter = (id: string) => {
const next = filters.filter((f) => f.id !== id);
setFilters(next);
onFiltersChange?.(next);
};
return (
<header className={cn("border-b border-da-border bg-da-bg px-4 py-3 text-da-fg sm:px-6", className)}>
<div className="flex items-center gap-3">
<h1 className="text-[15px] font-semibold">{title}</h1>
<span className="rounded-da-pill bg-da-muted px-2 font-da-mono text-[11px] text-da-muted-fg">{count}</span>
<button
type="button"
onClick={onPrimary}
className="da-focus da-transition ml-auto inline-flex h-8 items-center gap-1.5 rounded-da-md bg-da-primary px-3 text-[13px] font-medium text-da-primary-fg hover:bg-da-primary/90"
>
<Plus aria-hidden className="size-4" />
{primaryLabel}
</button>
</div>
<div className="mt-3 flex flex-wrap items-center gap-2">
<div className="relative w-full sm:w-56">
<Search aria-hidden className="pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-da-muted-fg" />
<input
type="search"
aria-label={`Search ${title.toLowerCase()}`}
value={query}
onChange={(e) => {
setInnerQuery(e.target.value);
onQueryChange?.(e.target.value);
}}
placeholder="Search…"
className="da-focus h-8 w-full rounded-da-md border border-da-border bg-da-input pr-2 pl-8 text-[13px] placeholder:text-da-muted-fg"
/>
</div>
<ul className="flex flex-wrap items-center gap-2" aria-label="Active filters">
{filters.map((f) => (
<li key={f.id} className="da-stroke inline-flex h-7 items-center overflow-hidden rounded-da-md bg-da-surface text-[12px] text-da-surface-fg">
<span className="px-2 text-da-muted-fg">{f.label}</span>
<span className="border-l border-da-border px-2 font-medium">{f.value}</span>
<button
type="button"
onClick={() => removeFilter(f.id)}
aria-label={`Remove filter ${f.label}: ${f.value}`}
className="da-focus grid h-full w-6 place-items-center border-l border-da-border text-da-muted-fg hover:bg-da-muted hover:text-da-fg"
>
<X aria-hidden className="size-3" />
</button>
</li>
))}
</ul>
<button
type="button"
className="da-focus da-transition inline-flex h-7 items-center gap-1.5 rounded-da-md px-2 text-[12px] text-da-muted-fg hover:bg-da-muted hover:text-da-fg"
>
<ListFilter aria-hidden className="size-3.5" />
Add filter
</button>
<div className="ml-auto inline-flex rounded-da-md bg-da-muted p-0.5" role="group" aria-label="View">
{(
[
{ v: "list", Icon: List, l: "List view" },
{ v: "board", Icon: LayoutGrid, l: "Board view" },
] as const
).map(({ v, Icon, l }) => (
<button
key={v}
type="button"
aria-label={l}
aria-pressed={view === v}
onClick={() => {
setInnerView(v);
onViewChange?.(v);
}}
className={cn(
"da-focus da-transition grid size-7 place-items-center rounded-[5px]",
view === v ? "bg-da-surface text-da-fg shadow-da-sm" : "text-da-muted-fg hover:text-da-fg",
)}
>
<Icon aria-hidden className="size-3.5" />
</button>
))}
</div>
</div>
</header>
);
}
export default HeaderToolbar;
modules/minimal/layout/header-toolbar/index.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title / count | string / number | — | Heading. |
| filters / onFiltersChange | { id, label, value }[] / fn | — | Initial chips. |
| query / onQueryChange | string / fn | — | Search. |
| view / onViewChange | "list" | "board" / fn | — | View toggle. |
| primaryLabel / onPrimary | string / fn | — | Main action. |
| className | string | — | Classes. |
Other app header variants in Minimal
App Header
Two-row app header: breadcrumbs, ⌘K search trigger and notification dot on top; view tabs with Filter / Display actions below. Includes a working command palette (Radix Dialog) with grouped, filterable, keyboard-navigable commands.
Header Detail
Detail-page header: breadcrumbs ending on a copyable mono id, title with status pill, a key/value meta row, action buttons and underline section tabs with counts.
Header Switcher
Vercel-style global top bar: logo then organization / project / environment switchers separated by slashes (production badge in red), with dropdown lists, help, notification dot and avatar.
App header in other art directions
App Header
Two-tier app header: top bar with breadcrumbs, ⌘K search field, notification bell with counter and avatar; page band with big title, meta line, primary action and folder-style tabs.
Header Compact
Dense 56px app header built from ruled cells: title with count chip, view tabs (yellow active cell), filter search, ink 'New' cell, and an optional strip of active filter chips.
Header Editor
Document/editor header: back cell, version chip, inline-editable uppercase title, save-status chip (saved/saving/unsaved), Preview cell and a yellow Publish cell; actions wrap to a full-width bar on mobile.
Header Stats
Dashboard welcome header: yellow band with eyebrow, big greeting, status sentence and two pressable actions, over a ruled KPI strip (2×2 on mobile, 4 across on desktop) with green delta chips.
App Header
Floating frosted pill top bar (search with ⌘K hint, gradient notification counter, avatar menu button) above a page heading with a frosted segmented tab switcher and a gradient primary action.
Header Document
Sticky glass editor header: breadcrumbs, inline-editable document title, saved/editing indicator, live viewers with green presence rings, gradient Share button and more menu.
Header Greeting
Dashboard header with a time-of-day greeting and day summary, notification bell with gradient counter, a large glass “Ask Halo” search bar with gradient submit and quick-action chips.
Header Meeting
In-call glass header pill: pulsing REC timer, meeting title, “Halo is taking notes” gradient chip, participant avatars, grid/speaker layout toggle, translate toggle and a red Leave button.
App Header
Path-style app header: slash-separated breadcrumb “Nord Studio / Projects / Oslo Opera” (last segment ink), live status with signal dot and last-edit time in mono, outline “Preview” and ink “Publish”.
Header Editor
Editor top bar in three zones: back arrow + editable page title, a centered square device switcher (desktop/tablet/mobile, radio semantics), and undo/redo text actions + save state + ink Publish.
Header Tabs
Settings-style header: title + domain subtitle, then a row of text tabs with an ink underline on the active one sitting on the hairline; scrolls horizontally on mobile.
Header Title
Big-title page header: a huge display title with a superscript mono count, then a ruled toolbar with text filters (slash separated, active underlined in signal) on the left and view options + ink action on the right.
App Header
Page header for app screens: breadcrumb trail, title + description, right-aligned secondary/primary actions and an optional row of key-value meta; white with a bottom border.
Header Global
Global top bar: logo, entity switcher (Radix dropdown), centered search with ⌘K hint, help + notifications (count) icon buttons and a user avatar menu (profile, settings, sign out).
Header Report
Report header: title with “last updated” + refresh, a toolbar with period segmented control, entity select, compare toggle and Export; wraps on mobile.
Header Tabs
Record header (e.g. a customer): avatar initials, name + status pill, subtitle, action buttons, and an underline tab bar (links with aria-current and counts) that scrolls horizontally on mobile.
App Header
Friendly app header: time-of-day serif greeting with the user’s name in italic sage, a calm subtitle, a rounded search field, bell with soft dot and an initials avatar.
Header Period
Report header: serif title with an italic period word that updates, a pill period switcher (radio semantics) and a soft export button; a wavy divider underneath.
Header Progress
Page header with a target ring: soft breadcrumb, serif title and description, and on the right a circular progress ring (sage stroke on sand) with the percentage and target label.
Header Tabs
Section header with pill tabs: serif title and a sage action on one row, then a sand track of pill links (active one cream with shadow, counts in small circles) that scrolls on mobile.
App Header
Friendly top header: “Good morning, Ana 👋” with a day summary; search pill, bell with red badge, periwinkle “New” button and emoji avatar on the right.
Header Board
Board page header: emoji tile, title and description, member emoji avatars, ink Share pill, then a pill view switcher (Board, List, Week) and a filter button.
Header Search
Search-first header: wide rounded search field with clear button, and emoji filter chips (Assigned to me, Due soon, Overdue, Done) that toggle to ink below.
Header Week
Week-planner header: round prev/next arrows around the week range (announced), a lavender “Today” pill and a mint progress pill with emoji and mini bar.