Status Strip
betaJoined status pills for the top of a home page: a label with an optional status, the value under it, and controls at the end.
Preview
segments, aside
- Sat 3 Oct · Demo day
- Product designer
- £15 due Fri
trailing
- Tue 6 Oct · 19:00
- 22 going
a narrow column
- Sat 3 Oct
- £15 due
- Ordered
Install
1. Add the registry to
components.json, once per app. Without it, the shadcn CLI looks up@txbrendanin a public list that txbrendan/ui does not control.npx shadcn@latest registry add "@txbrendan=https://txbrendan.dev/r/{name}.json"2. Add the theme, once per app. It replaces your color tokens with ones checked for contrast.
npx shadcn@latest add @txbrendan/theme3. Add the component.
npx shadcn@latest add @txbrendan/status-strip
Use it for
- The few facts a home page leads with, top right: next event, your status, an invoice due.
- Each segment has a label on line 1 and a value on line 2. aside puts a status right after the label, like a StatusText.
- trailing is for controls only, like Yes and No buttons, centered across both lines.
- It hugs its content. In a narrow column its segments wrap onto more rows and stay joined.
Avoid it for
- More than four segments. Put the rest on the page.
- Long values. Keep each to a few words, like a date and a team.
- Links or text in trailing. Put a link in the value's page instead.
Props
- segments
Required. The pills, in order.
{ label: string; value: string; aside?: ReactNode; trailing?: ReactNode }[]
- className
Extra classes on the strip. Later classes win.
string
| Prop | Type | Default | What it does |
|---|---|---|---|
| segments | { label: string; value: string; aside?: ReactNode; trailing?: ReactNode }[] | - | Required. The pills, in order. |
| className | string | - | Extra classes on the strip. Later classes win. |
Accessibility
- A description list: each label is a <dt>, and its status, value, and controls are <dd>s, so screen readers read each pair together.
- The 1px lines between segments are gaps that show the border color, so they stay in forced colors.
- Controls in trailing need their own names, like "Yes, I'm going".
Examples
Two facts for a home page
<StatusStrip
segments={[
{ label: "Next event", value: "Sat 3 Oct · Demo day" },
{ label: "Invoice", value: "£15 due Fri" },
]}
/>