Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

App shells

4 examples. Resize any preview to see it at phone and tablet widths.

Elite App Shell

Pro

The Elite Mail Works dashboard shell: a grouped sidebar that folds to an icon rail with tooltips and remembers the choice, a drawer on phones, a header with a command palette, notifications and an account menu, and a sample Home page inside it.

The source for this block is part of Truffle Pro.

Top Navigation Shell

Pro

An app shell with navigation across the top: a workspace switcher, sections with an underline that grows under the current one, a second row of tabs, search, notifications and an account menu. The sections move into a drawer on phones.

The source for this block is part of Truffle Pro.

Icon Rail Shell

Pro

An app shell with two columns of navigation: a rail of icons with tooltips and unread counts, and a panel of what is inside the chosen area. The panel folds into a drawer on tablets, and the rail joins it on phones.

The source for this block is part of Truffle Pro.

Page Headers

Free

Four page headers to copy: title with actions; path, status and facts; title with tabs; and a cover with an avatar and figures.

Hide code
components/blocks/page-headers.tsx
import { ChevronRight, Download, Ellipsis, Pencil, Plus, Share2 } from "lucide-react";
import { Avatar } from "@/components/viewport/avatar";
import { Badge } from "@/components/viewport/badge";
import { Button } from "@/components/viewport/button";

const crumb = "rounded-sm outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring";
const tab = "relative inline-flex h-10 items-center px-1 text-sm font-medium text-muted-foreground outline-none transition-colors duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring aria-[current]:text-foreground aria-[current]:after:absolute aria-[current]:after:inset-x-0 aria-[current]:after:-bottom-px aria-[current]:after:h-0.5 aria-[current]:after:rounded-full aria-[current]:after:bg-foreground motion-reduce:transition-none";

/** Four page headers, from the plainest to the fullest. Each is a `header` with one heading; copy the one that fits. */
export default function PageHeaders() {
  return (
    <div className="mx-auto flex w-full max-w-5xl flex-col gap-12 bg-background px-4 py-10 text-foreground sm:px-8">
      <section aria-label="Header with a title and actions" className="flex flex-col gap-2">
        <p className="text-xs font-medium text-muted-foreground">1. Title and actions</p>
        <header className="flex flex-wrap items-end justify-between gap-4 border-b border-border pb-5">
          <div>
            <h2 className="text-2xl font-semibold tracking-tight">Contacts</h2>
            <p className="mt-1 text-sm text-muted-foreground">1,284 people across 318 companies.</p>
          </div>
          <div className="flex flex-wrap items-center gap-2">
            <Button variant="outline">
              <Download aria-hidden />
              Export
            </Button>
            <Button>
              <Plus aria-hidden />
              New contact
            </Button>
          </div>
        </header>
      </section>

      <section aria-label="Header with a path and a status" className="flex flex-col gap-2">
        <p className="text-xs font-medium text-muted-foreground">2. Path, status and facts</p>
        <header className="flex flex-col gap-4 border-b border-border pb-5">
          <nav aria-label="Path">
            <ol className="flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground">
              <li>
                <a href="#deals" className={crumb}>
                  Deals
                </a>
              </li>
              <li aria-hidden>
                <ChevronRight className="size-3.5 rtl:-scale-x-100" />
              </li>
              <li>
                <a href="#northwind" className={crumb}>
                  Northwind Trading
                </a>
              </li>
              <li aria-hidden>
                <ChevronRight className="size-3.5 rtl:-scale-x-100" />
              </li>
              <li aria-current="page" className="text-foreground">
                Renewal 2027
              </li>
            </ol>
          </nav>
          <div className="flex flex-wrap items-start justify-between gap-4">
            <div className="min-w-0">
              <h2 className="flex flex-wrap items-center gap-3 text-2xl font-semibold tracking-tight">
                Northwind renewal
                <Badge tone="info" dot>
                  Proposal
                </Badge>
              </h2>
              <dl className="mt-2 flex flex-wrap gap-x-6 gap-y-1 text-sm">
                {[
                  ["Value", "$48,000"],
                  ["Closes", "December 18"],
                  ["Owner", "Theo Okafor"],
                ].map(([term, value]) => (
                  <div key={term} className="flex gap-1.5">
                    <dt className="text-muted-foreground">{term}</dt>
                    <dd className="font-medium tabular-nums">{value}</dd>
                  </div>
                ))}
              </dl>
            </div>
            <div className="flex items-center gap-2">
              <Button variant="outline">
                <Pencil aria-hidden />
                Edit
              </Button>
              <Button>Mark as won</Button>
              <Button variant="ghost" size="icon" aria-label="More actions">
                <Ellipsis aria-hidden />
              </Button>
            </div>
          </div>
        </header>
      </section>

      <section aria-label="Header with tabs" className="flex flex-col gap-2">
        <p className="text-xs font-medium text-muted-foreground">3. Title and tabs</p>
        <header className="border-b border-border">
          <div className="flex flex-wrap items-center justify-between gap-4 pb-3">
            <h2 className="text-2xl font-semibold tracking-tight">Settings</h2>
            <Button variant="outline" size="sm">
              <Share2 aria-hidden />
              Invite
            </Button>
          </div>
          <nav aria-label="Settings sections" className="-mb-px overflow-x-auto [scrollbar-width:none]">
            <ul className="flex gap-6">
              {["General", "Team", "Billing", "Security", "Integrations"].map((name, i) => (
                <li key={name} className="shrink-0">
                  <a href={`#${name.toLowerCase()}`} aria-current={i === 1 ? "page" : undefined} className={tab}>
                    {name}
                  </a>
                </li>
              ))}
            </ul>
          </nav>
        </header>
      </section>

      <section aria-label="Header for a person or a workspace" className="flex flex-col gap-2">
        <p className="text-xs font-medium text-muted-foreground">4. Cover, avatar and figures</p>
        <header className="overflow-hidden rounded-2xl border border-border bg-card">
          <div aria-hidden className="h-24 bg-[radial-gradient(80%_140%_at_15%_0%,oklch(0.62_0.12_250/0.55),transparent_60%),radial-gradient(70%_140%_at_90%_100%,oklch(0.6_0.13_28/0.5),transparent_60%)]" />
          <div className="flex flex-wrap items-end justify-between gap-4 px-5 pb-5">
            <div className="flex min-w-0 items-end gap-4">
              <Avatar name="Northwind Trading" size="xl" className="-mt-8 ring-4 ring-card" />
              <div className="min-w-0 pb-0.5">
                <h2 className="truncate text-xl font-semibold tracking-tight">Northwind Trading</h2>
                <p className="truncate text-sm text-muted-foreground">Wholesale · San Francisco · Customer since 2024</p>
              </div>
            </div>
            <dl className="flex gap-6 text-sm">
              {[
                ["Contacts", "14"],
                ["Open deals", "2"],
                ["Lifetime value", "$212k"],
              ].map(([term, value]) => (
                <div key={term} className="flex flex-col-reverse">
                  <dt className="text-xs text-muted-foreground">{term}</dt>
                  <dd className="text-lg font-semibold tabular-nums tracking-tight">{value}</dd>
                </div>
              ))}
            </dl>
          </div>
        </header>
      </section>
    </div>
  );
}