Genesis
@stable

ResourceHeader

The header of a page that edits one publishable thing (a form, a course, a lesson, a worksheet): the breadcrumb ("Courses › name"), the title once, its status and save-state chips, and on the right undo and redo, Preview, Share and Publish. Every action is the host's; a button shows only when its handler is given.

packages/ui/src/components/resource/ResourceHeader.tsx

Import
Subpath export: @marktiderman/genesis-ui
import { ResourceHeader } from "@marktiderman/genesis-ui";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

ResourceHeader

The header of a page that edits one publishable thing (a form, a course, a lesson, a worksheet): the breadcrumb ("Courses › name"), the title once, its status and save-state chips, and on the right undo and redo, Preview, Share and Publish. Every action is the host's; a button shows only when its handler is given.

PropTypeDefaultDescription
title*string—The title, shown once: as the heading and the breadcrumb's last part.
actionsReactNode—Anything else for the right-hand side, before Preview (a Reload button, a menu).
canRedobooleantrue
canUndobooleantrue
chipsreadonly { label: string; tone: ChipTone; }[]—More chips after the status (a record's kind, its triage).
classNamestring—
leadingReactNode—Before the title, in the leading area: a switcher between records, say.
onPreview(() => void)—A Preview button.
onRedo(() => void)—
onShare(() => void)—A Share button (open a share dialog).
onUndo(() => void)—Undo and redo buttons, shown when given (for example the builder's history).
parentReactNode—The breadcrumb's parent link, e.g. `<Link to="/courses">Courses</Link>`: one element, so the host's router renders it.
publish{ onClick: () => void; label?: string; loading?: boolean; disabled?: boolean | undefined; } | undefined—The primary button: "Publish", or "Publish changes" once it is live.
saveStateenum—Where saving the draft stands; no chip when absent.
status{ label: string; tone: ChipTone; }—The status chip, e.g. "Live · version 3" or "Draft" (forms-studio's formStatusChip makes a form's).
subtitlestring—A muted line under the title: an id, a parent, a feature ("T-8 · Team work").
untitledstringUntitledShown when the title is empty. Default "Untitled".