Skip to content

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-flat/layout/header-week
Open ↗

Source

"use client";

import { useState } from "react";
import { ChevronLeft, ChevronRight } from "lucide-react";
import { cn } from "@/lib/utils";

export interface HeaderWeekProps {
  /** ISO Monday of the initial week. */
  weekStart?: string;
  onWeekChange?: (iso: string) => void;
  progress?: { done: number; total: number };
  className?: string;
}

function shift(iso: string, days: number) {
  const d = new Date(`${iso}T12:00:00`);
  d.setDate(d.getDate() + days);
  return d.toISOString().slice(0, 10);
}

/** Week-planner header: prev/next arrows around the week range, a “Today” pill, and a mint week-progress pill with a mini bar. */
export function HeaderWeek({ weekStart = "2026-10-05", onWeekChange, progress = { done: 18, total: 31 }, className }: HeaderWeekProps) {
  const [start, setStart] = useState(weekStart);
  const go = (n: number) => {
    const next = n === 0 ? weekStart : shift(start, n * 7);
    setStart(next);
    onWeekChange?.(next);
  };
  const fmt = (iso: string) => new Date(`${iso}T12:00:00`).toLocaleDateString("en-US", { month: "short", day: "numeric" });
  const pct = Math.round((progress.done / progress.total) * 100);

  return (
    <header className={cn("flex flex-wrap items-center gap-3 bg-da-bg px-4 py-5 text-da-fg sm:px-8", className)}>
      <div className="flex items-center gap-2">
        <button
          type="button"
          aria-label="Previous week"
          onClick={() => go(-1)}
          className="da-focus grid size-11 place-items-center rounded-full bg-da-surface shadow-da-sm hover:-translate-x-0.5"
        >
          <ChevronLeft aria-hidden className="size-5" />
        </button>
        <h1 className="min-w-44 text-center font-da-display text-2xl font-extrabold tracking-da-display" aria-live="polite">
          {fmt(start)} – {fmt(shift(start, 4))}
        </h1>
        <button
          type="button"
          aria-label="Next week"
          onClick={() => go(1)}
          className="da-focus grid size-11 place-items-center rounded-full bg-da-surface shadow-da-sm hover:translate-x-0.5"
        >
          <ChevronRight aria-hidden className="size-5" />
        </button>
      </div>
      <button
        type="button"
        onClick={() => go(0)}
        disabled={start === weekStart}
        className="da-focus inline-flex h-11 items-center rounded-da-pill bg-da-primary/12 px-5 font-semibold disabled:opacity-50"
      >
        Today
      </button>
      <div className="ml-auto flex items-center gap-3 rounded-da-pill bg-da-secondary py-2 pr-4 pl-3 text-da-secondary-fg">
        <span aria-hidden className="text-lg">
          🌿
        </span>
        <span className="text-sm font-semibold">
          {progress.done}/{progress.total} done
        </span>
        <span
          className="h-2 w-20 overflow-hidden rounded-full bg-da-surface/70"
          role="progressbar"
          aria-valuenow={pct}
          aria-valuemin={0}
          aria-valuemax={100}
          aria-label="Week progress"
        >
          <span className="block h-full rounded-full bg-da-secondary-fg" style={{ width: `${pct}%` }} />
        </span>
      </div>
    </header>
  );
}

export default HeaderWeek;

modules/soft-flat/layout/header-week/index.tsx

Props

PropTypeDefaultDescription
weekStartstring—ISO Monday.
onWeekChange(iso: string) => void—Handler.
progress{ done, total }—Week progress.

Other app header variants in Soft Flat

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

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