Skip to content

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-clean/layout/header-editor
Open ↗

Source

"use client";

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

export interface HeaderEditorProps {
  title?: string;
  backHref?: string;
  onDeviceChange?: (device: "desktop" | "tablet" | "mobile") => void;
  className?: string;
}

/** 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. */
export function HeaderEditor({ title = "Oslo Opera — Identity", backHref = "#projects", onDeviceChange, className }: HeaderEditorProps) {
  const [device, setDevice] = useState<"desktop" | "tablet" | "mobile">("desktop");
  const [name, setName] = useState(title);
  const id = useId();
  const devices = [
    { v: "desktop", icon: Monitor, l: "Desktop" },
    { v: "tablet", icon: Tablet, l: "Tablet" },
    { v: "mobile", icon: Smartphone, l: "Mobile" },
  ] as const;
  return (
    <header className={cn("grid h-14 grid-cols-[1fr_auto_1fr] items-center gap-4 border-b border-da-border bg-da-bg px-3 text-da-fg", className)}>
      <div className="flex min-w-0 items-center gap-2">
        <a href={backHref} aria-label="Back to projects" className="da-focus grid size-9 shrink-0 place-items-center rounded-da-sm hover:bg-da-surface-2">
          <ArrowLeft aria-hidden className="size-4" />
        </a>
        <label className="sr-only" htmlFor={id}>
          Page title
        </label>
        <input
          id={id}
          value={name}
          onChange={(e) => setName(e.target.value)}
          className="da-focus min-w-0 flex-1 rounded-da-sm bg-transparent px-1 py-1 font-medium outline-none hover:bg-da-surface-2 focus:bg-da-surface-2"
        />
      </div>
      <div role="radiogroup" aria-label="Preview device" className="flex border border-da-border">
        {devices.map((d) => (
          <button
            key={d.v}
            type="button"
            role="radio"
            aria-checked={device === d.v}
            aria-label={d.l}
            title={d.l}
            onClick={() => {
              setDevice(d.v);
              onDeviceChange?.(d.v);
            }}
            className={cn(
              "da-focus grid size-9 place-items-center border-da-border not-first:border-l",
              device === d.v ? "bg-da-fg text-da-bg" : "text-da-muted-fg hover:text-da-fg",
            )}
          >
            <d.icon aria-hidden className="size-4" strokeWidth={1.5} />
          </button>
        ))}
      </div>
      <div className="flex items-center justify-end gap-4">
        <span className="hidden font-da-mono text-[11px] tracking-da-label text-da-muted-fg uppercase md:inline">Saved</span>
        <button type="button" className="da-focus hidden rounded-da-sm font-da-mono text-[11px] tracking-da-label uppercase hover:underline sm:inline">
          Undo
        </button>
        <button type="button" className="da-focus h-9 rounded-da-sm bg-da-primary px-3 text-sm font-medium text-da-primary-fg hover:opacity-85">
          Publish
        </button>
      </div>
    </header>
  );
}

export default HeaderEditor;

modules/mono-clean/layout/header-editor/index.tsx

Props

PropTypeDefaultDescription
titlestring—Heading.
backHrefstring—Back Href.
onDeviceChange(device: "desktop" | "tablet" | "mobile") => void—Callback.
classNamestring—Extra classes on the root.

Other app header variants in Mono Clean

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.

BrutalistApp header

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.

BrutalistApp header

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.

BrutalistApp header

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.

BrutalistApp header

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

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