Header Bar
Something to go back with, a title, and the actions for the whole thing.
CT chest — ACC-482913
Installation
npx shadcn@latest add https://qure-ui.qure.ai/r/header-bar.jsonUsage
import {
HeaderBar, HeaderBarActions, HeaderBarContent,
HeaderBarDescription, HeaderBarTitle,
} from '@/components/ui/header-bar'<HeaderBar divider>
<Button variant="tertiary"><ArrowLeftIcon />Back</Button>
<HeaderBarTitle>CT chest — ACC-482913</HeaderBarTitle>
<HeaderBarActions>
<Button variant="tertiary" size="icon-md" aria-label="More actions">
<MoreHorizontalIcon />
</Button>
</HeaderBarActions>
</HeaderBar>This is one of the components with no shadcn equivalent. It comes from the Qure design system.
Figma's axis has four values — large, medium, dialogue, notification — but only two of them are
a different bar. dialogue and notification are the medium bar in a modal; they say where it
is used, not what it is. So the prop here is size, and the modal frames become compositions
rather than variants.
Composition
<HeaderBar> {/* owns size, background and the optional divider */}
{/* leading — a back button, a close, or nothing */}
<HeaderBarContent> {/* only needed when there is a description */}
<HeaderBarTitle>
<HeaderBarDescription>
</HeaderBarContent>
<HeaderBarActions> {/* trailing icon buttons */}
</HeaderBar>The leading slot is deliberately not a component. What goes there is a back button, a close
button, an avatar or nothing at all, and wrapping that in a HeaderBarLeading would only add a
name for a <div> you did not need.
Size
lgReporting queue
mdReporting queue
lg is a whole page or the top of a drawer, with the title in Heading. md is a panel, a section
or a modal, with the title in Subheading. Match the button sizes to the bar — md buttons in the
large bar, sm in the medium one.
With a description
HeaderBarContent stacks the title and its second line and keeps them sharing the flexible width,
so a long title truncates rather than shoving the actions off the end. Without a description you
do not need it — put HeaderBarTitle straight in the bar.
Heading level
Worklist
Priors
The title renders an <h2>, because a bar is rarely the top of the document. render moves it:
<HeaderBarTitle render={<h1 />}>Worklist</HeaderBarTitle>Get this right rather than leaving it. A screen reader user navigates by heading, and a page whose
outline starts at h2 and then skips to h4 is a page they have to read in full to understand
the shape of.
Building a modal
The Figma "Modal — Dialogue / Notification / Interactive" frames are not components. Each is a header bar, a body and an Action Bar at one of four widths:
| Frame | Width | Surface |
|---|---|---|
| Dialogue | 360px | base-secondary |
| Notification | 480px | base-default |
| Interactive | 520px | base-secondary |
| Navigation | 840×560 | a rail beside a panel |
There is a worked example of each: the first three on the Action Bar page, and Navigation on the Dialog page.
Size a Dialog with max-w-* on DialogContent and compose the bars
inside it. There is a worked example on the Action Bar
page.
API Reference
HeaderBar
Renders a <header>.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "lg" | "md" | "lg" | Page or drawer, versus panel or modal. |
divider | boolean | false | A 0.5px hairline along the bottom edge. |
HeaderBarTitle
| Prop | Type | Default | Description |
|---|---|---|---|
render | ReactElement | <h2 /> | Change the heading level to fit the outline. |
HeaderBarContent and HeaderBarActions render <div>s, HeaderBarDescription a <p>.