Skip to content

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.

brutalist/layout/header-editor
Open ↗

Source

"use client";

import { useId, useState } from "react";
import { ArrowLeft, Eye } from "lucide-react";
import { cn } from "@/lib/utils";

export type HeaderEditorStatus = "saved" | "saving" | "unsaved";

export interface HeaderEditorProps {
  backHref?: string;
  defaultTitle?: string;
  onTitleChange?: (title: string) => void;
  status?: HeaderEditorStatus;
  version?: string;
  previewHref?: string;
  onPublish?: () => void;
  publishLabel?: string;
  className?: string;
}

const STATUS: Record<HeaderEditorStatus, { label: string; tone: string }> = {
  saved: { label: "Saved", tone: "bg-da-success text-da-success-fg" },
  saving: { label: "Saving…", tone: "bg-da-warning text-da-warning-fg" },
  unsaved: { label: "Unsaved changes", tone: "bg-da-accent text-da-accent-fg" },
};

export function HeaderEditor({
  backHref = "#releases",
  defaultTitle = "AI summaries for every release",
  onTitleChange,
  status = "saved",
  version = "v4.2.0",
  previewHref = "#preview",
  onPublish,
  publishLabel = "Publish",
  className,
}: HeaderEditorProps) {
  const [title, setTitle] = useState(defaultTitle);
  const inputId = useId();
  const s = STATUS[status];

  return (
    <header className={cn("da-stroke-b bg-da-surface text-da-surface-fg", className)}>
      <div className="flex min-h-16 flex-wrap items-stretch">
        <a href={backHref} aria-label="Back to releases" className="da-focus da-stroke-r grid w-16 place-items-center hover:bg-da-primary hover:text-da-primary-fg">
          <ArrowLeft aria-hidden className="size-5" strokeWidth={3} />
        </a>
        <div className="flex min-w-0 flex-1 items-center gap-3 px-4 py-2">
          <span className="da-stroke shrink-0 bg-da-fg px-2 py-1 font-da-mono text-xs font-bold text-da-bg">{version}</span>
          <label htmlFor={inputId} className="sr-only">
            Release title
          </label>
          <input
            id={inputId}
            value={title}
            onChange={(e) => {
              setTitle(e.target.value);
              onTitleChange?.(e.target.value);
            }}
            className="da-focus min-w-0 flex-1 bg-transparent font-da-display text-xl tracking-da-display uppercase outline-none hover:bg-da-muted focus:bg-da-muted"
          />
          <span role="status" className={cn("da-stroke hidden shrink-0 px-2 py-1 font-da-mono text-[11px] font-bold uppercase sm:block", s.tone)}>
            {s.label}
          </span>
        </div>
        <div className="flex w-full sm:w-auto">
          <a href={previewHref} className="da-focus da-stroke-l flex flex-1 items-center justify-center gap-2 px-5 font-bold hover:bg-da-muted sm:flex-none">
            <Eye aria-hidden className="size-4" />
            Preview
          </a>
          <button type="button" onClick={onPublish} className="da-focus da-stroke-l flex-1 bg-da-primary px-6 py-4 font-bold text-da-primary-fg hover:bg-da-fg hover:text-da-bg sm:flex-none">
            {publishLabel}
          </button>
        </div>
      </div>
    </header>
  );
}

export default HeaderEditor;

modules/brutalist/layout/header-editor/index.tsx

Props

PropTypeDefaultDescription
backHrefstring—Back link.
defaultTitle / onTitleChangestring / (title: string) => void—Editable title and change handler.
status"saved" | "saving" | "unsaved""saved"Save status chip.
versionstring—Version chip.
previewHrefstring—Preview link.
onPublish / publishLabel() => void / string—Publish action.
classNamestring—Classes on the <header>.

Other app header variants in Brutalist

App header in other art directions

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.

GlassApp header

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.

GlassApp header

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.

GlassApp header

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.

GlassApp header

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.

MinimalApp header

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.

MinimalApp header

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.

MinimalApp header

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.

MinimalApp header

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”.

Mono CleanApp header

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.

Mono CleanApp header

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.

Mono CleanApp header

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.

Mono CleanApp header

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.

Neo CorporateApp header

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).

Neo CorporateApp header

Header Report

Report header: title with “last updated” + refresh, a toolbar with period segmented control, entity select, compare toggle and Export; wraps on mobile.

Neo CorporateApp header

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.

Neo CorporateApp header

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.

Organic SoftApp header

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.

Organic SoftApp header

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.

Organic SoftApp header

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.

Organic SoftApp header

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.

Soft FlatApp header

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.

Soft FlatApp header

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.

Soft FlatApp header

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.

Soft FlatApp header