Skip to content
Haze UI

Status

Small colored dot followed by a text label for a live state such as Operational, Degraded or Offline.

pnpm dlx shadcn@latest add @haze/status
Open preview in a new tab
Liveno JavaScript

When to use

  • Service health, deploy state or presence in a table row or header
  • A state that can change while the page is open and deserves a gentle pulse
  • Labels where a full badge would be too heavy

When not to use

  • A message that needs a sentence of explanation; use alert
  • A count or category tag; use badge

Installation

Add the Haze registry to components.json once, then install Status with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/status
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
variant"default" | "info" | "success" | "warning" | "destructive""default"Color of the dot.
label*string–State name shown next to the dot.
pulsebooleanfalseFor a live state: adds a halo that pings outward behind the dot.
classstring–Extra classes on the wrapper.

Accessibility

  • The word is the status; the dot is aria-hidden and only repeats it in color, so "Degraded" is read out whatever the variant.
  • Write the label as the state itself, "Offline" rather than "Red", so it still makes sense in forced-colors mode.
  • The halo sits inside the aria-hidden dot wrapper, so assistive technology ignores it. It stops under prefers-reduced-motion, leaving the plain dot and the text.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Status" with `npx shadcn@latest add @haze/status`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Status from "@/components/haze/ui/status.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/status.md

  • Customize with real content

    Adapt the Haze status ui for our product. Replace the demo values of these props with our real content: variant, label, pulse, class. Keep the layout, the heading level rules and these accessibility details: The word is the status; the dot is aria-hidden and only repeats it in color, so "Degraded" is read out whatever the variant. Write the label as the state itself, "Offline" rather than "Red", so it still makes sense in forced-colors mode. The halo sits inside the aria-hidden dot wrapper, so assistive technology ignores it. It stops under prefers-reduced-motion, leaving the plain dot and the text. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using status, check it fits: use it when service health, deploy state or presence in a table row or header; a state that can change while the page is open and deserves a gentle pulse; labels where a full badge would be too heavy. Avoid it when a message that needs a sentence of explanation; use alert; a count or category tag; use badge. Alternatives: @haze/badge, @haze/alert, @haze/tag.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog