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-uiimport { 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | The title, shown once: as the heading and the breadcrumb's last part. |
| actions | ReactNode | — | Anything else for the right-hand side, before Preview (a Reload button, a menu). |
| canRedo | boolean | true | |
| canUndo | boolean | true | |
| chips | readonly { label: string; tone: ChipTone; }[] | — | More chips after the status (a record's kind, its triage). |
| className | string | — | |
| leading | ReactNode | — | 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). |
| parent | ReactNode | — | 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. |
| saveState | enum | — | 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). |
| subtitle | string | — | A muted line under the title: an id, a parent, a feature ("T-8 · Team work"). |
| untitled | string | Untitled | Shown when the title is empty. Default "Untitled". |