Skip to content

PageHeader

The top of a page: its name, one line that says what is here, and the main thing the person can do.

import { PageHeader, PageHeaderSkeleton } from '@sypnia/ui/react'

On this page
  1. Title, lead and main action
  2. Icon and several actions
  3. In its place
  4. Skeleton
  5. When to use it
  6. For everyone
  7. Props

Title, lead and main action

One sentence and one button.

Tables

Everything the project Storefront stores, one table for each kind of thing.

Code
import { Button, PageHeader } from '@sypnia/ui/react';

// The name of the page, one line about it, and the main thing to do here.
export default function Basic() {
  return (
    <PageHeader title="Tables" lead="Everything the project Storefront stores, one table for each kind of thing."
      actions={<Button variant="primary" icon="plus">New table</Button>} />
  );
}

Icon and several actions

One primary action; the others are quieter.

API keys

Keys let your apps and servers talk to this project.

Code
import { Button, IconButton, PageHeader } from '@sypnia/ui/react';

// One primary action; the others are quieter. On a phone the buttons go under the title, two by two.
export default function WithIconAndActions() {
  return (
    <PageHeader icon="key" title="API keys" lead="Keys let your apps and servers talk to this project."
      actions={<>
        <IconButton variant="secondary" icon="download" label="Export the list" />
        <Button>Read the guide</Button>
        <Button variant="primary" icon="plus">New key</Button>
      </>} />
  );
}

In its place

Under the breadcrumb and above the content.

Webhooks

Sypnia calls your server when something changes.

No webhooks yet

Add one to know the moment an order is created or paid.
Code
import { Breadcrumb, Button, EmptyState, Page, PageHeader } from '@sypnia/ui/react';

// Where it sits: under the breadcrumb, above the content of the page.
export default function InAPage() {
  return (
    <Page>
      <Breadcrumb items={[{ label: 'Northwind', href: '#' }, { label: 'Storefront', href: '#' }, { label: 'Webhooks' }]} />
      <PageHeader title="Webhooks" lead="Sypnia calls your server when something changes." actions={<Button variant="primary" icon="plus">New webhook</Button>} />
      <EmptyState compact icon="link" title="No webhooks yet">Add one to know the moment an order is created or paid.</EmptyState>
    </Page>
  );
}

Skeleton

The real piece and its skeleton: the same box, so nothing moves when the data arrives.

orders

1,204 rows · updated 2 minutes ago

Code
import { Button, PageHeader, PageHeaderSkeleton } from '@sypnia/ui/react';

// The top of a page while the name of what it shows loads. The skeleton has the same box as the real one, so nothing moves when the data arrives.
export default function Skeleton() {
  return (
    <div className="sy-stack">
      <PageHeader title="orders" lead="1,204 rows · updated 2 minutes ago" actions={<Button variant="primary" icon="plus">Add a row</Button>} />
      <PageHeaderSkeleton />
    </div>
  );
}

When to use it

Use it when

  • Every page of an app starts with one.
  • The main action of the page goes here, once, as the primary button.
  • The lead is one plain sentence: what this place holds or is for.

Do not use it when

  • It titles a region inside a page: that is a Panel.
  • You need tabs or filters: they go under the header, not inside it.
  • There would be more than three actions: keep the main one and move the rest into a Menu.

For everyone

  • The title is the only h1 of the page: screen readers and search engines use it as the page’s name.
  • It is the header landmark of its page; actions follow the title in the Tab order.
  • On phones the actions go under the title, two by two, at least 44 px tall.

Props

PageHeaderTypeDefault
titlerequired ReactNode
actions ReactNode
icon "function" | "error" | "replay" | "performance" | "uptime" | "traces" | "rage-click" | "dead-click" | "alert" | "summary" | "watch" | "sleep" | "light" | "suggestion" | "prompt" | "mcp" | "pull-request" | "git-branch" | "fix" | "check" | "open-source" | "self-host" | "sdk" | "engine" | "signals-in" | "web" | "mobile" | "backend" | "cloud" | "data" | "user" | "clock" | "shield" | "lock" | "mail" | "star" | "copy" | "arrow-right" | "arrow-up-right" | "chevron-down" | "plus" | "close" | "play" | "pause" | "search" | "info" | "warning" | "trash" | "menu" | "download" | "upload" | "filter" | "home" | "table" | "key" | "users" | "sun" | "moon" | "globe" | "sign-out" | "link" | "edit" | "calendar" | "chevron-left" | "chevron-right" | "chevron-up" | "minus" | "more" | "sort" | "arrow-left" | "arrow-up" | "arrow-down" | "arrow-down-right" | "arrow-down-left" | "arrow-up-left" | "swap" | "swap-vertical" | "chevrons-up-down" | "chevrons-left" | "chevrons-right" | "chevrons-down" | "chevrons-up" | "enter" | "undo" | "redo" | "refresh" | "expand" | "collapse" | "fullscreen" | "fullscreen-exit" | "move" | "grip" | "more-vertical" | "trend-up" | "trend-down" | "log-in" | "external" | "slash" | "equal" | "check-small" | "close-small" | "success" | "failure" | "help" | "plus-circle" | "minus-circle" | "ban" | "pending" | "dot" | "dot-off" | "bolt" | "flag" | "pin" | "bookmark" | "heart" | "thumbs-up" | "thumbs-down" | "sparkle" | "target" | "idea" | "award" | "crown" | "bell" | "bell-off" | "bug" | "fire" | "leaf" | "file" | "file-text" | "file-code" | "file-plus" | "file-check" | "file-table" | "file-lock" | "files" | "folder" | "folder-open" | "folder-plus" | "archive" | "clipboard" | "clipboard-check" | "paperclip" | "image" | "save" | "cloud-upload" | "cloud-download" | "cloud-off" | "import" | "export" | "share" | "inbox" | "send" | "box" | "layers" | "tag" | "hash" | "at" | "qr-code" | "book" | "book-open" | "notebook" | "rows" | "columns" | "grid" | "list" | "list-ordered" | "list-checks" | "kanban" | "chart-line" | "chart-bar" | "chart-area" | "chart-parts" | "chart-scatter" | "gauge" | "funnel" | "heatmap" | "sparkline" | "percent" | "sum" | "variable" | "braces" | "brackets" | "null" | "primary-key" | "relation" | "index" | "query" | "backup" | "migrate" | "seed" | "csv" | "json" | "bold" | "italic" | "underline" | "strikethrough" | "heading" | "text" | "paragraph" | "quote" | "code" | "align-left" | "align-center" | "align-right" | "indent" | "outdent" | "unlink" | "scissors" | "eraser" | "highlight" | "duplicate" | "paste" | "wand" | "palette" | "brush" | "ruler" | "crop" | "user-plus" | "user-minus" | "user-check" | "user-x" | "user-circle" | "team" | "organization" | "id-card" | "contact" | "role" | "chat" | "chats" | "comment" | "phone" | "video" | "mic" | "mic-off" | "megaphone" | "rss" | "mail-open" | "handshake" | "wave" | "desktop" | "laptop" | "tablet" | "terminal" | "window" | "browser" | "server" | "cpu" | "memory" | "disk" | "network" | "wifi" | "wifi-off" | "plug" | "power" | "container" | "queue" | "cron" | "webhook" | "api" | "route" | "load-balancer" | "dns" | "domain" | "certificate" | "firewall" | "rocket" | "deploy" | "rollback" | "logs" | "test" | "pipeline" | "commit" | "merge" | "fork" | "release" | "environment" | "region" | "robot" | "agent" | "puzzle" | "credit-card" | "wallet" | "receipt" | "invoice" | "cart" | "bag" | "coins" | "dollar" | "gift" | "plan" | "upgrade" | "usage" | "bank" | "history" | "timer" | "hourglass" | "calendar-check" | "calendar-plus" | "map" | "compass" | "translate" | "accessibility" | "keyboard" | "pointer" | "hand" | "print" | "support" | "stop" | "record" | "skip-forward" | "skip-back" | "fast-forward" | "rewind" | "volume" | "mute" | "camera" | "zoom-in" | "zoom-out" | "eye-off" | "sliders" | "settings" | "toggle" | "sidebar-left" | "sidebar-right" | "panel-bottom" | "split" | "layout" | "dashboard" | "cards" | "density" | "dark-mode" | "theme" | "mouse" | "cursor" | "select" | "picture-in-picture" | "scan" | "unlock" | "shield-off" | "shield-alert" | "shield-user" | "password" | "fingerprint" | "two-factor" | "policy" | "incognito" | "verified" | "audit" | "secret" | "p-telemetry" | "p-cases" | "p-agent" | "p-git" | "p-data" | "p-files" | "p-run" | "p-ai" | "p-mail" | "p-domains" | "p-design" | "p-learn" | "p-skills" | "p-app" | "p-ui"
lead ReactNode
PageHeaderSkeletonTypeDefault
actions number 1
lead boolean true
  1. Title, lead and main action
  2. Icon and several actions
  3. In its place
  4. Skeleton
  5. When to use it
  6. For everyone
  7. Props

    Search pages, sections and terms