# Status

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

- Kind: ui · Category: Feedback · Interactivity: none
- Install: `npx shadcn@latest add @haze/status`
- File: `src/components/haze/ui/status.astro`
- npm dependencies: none
- Registry dependencies: @haze/utils
- Docs page: https://hazeui.com/ui/status

## Use 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 when
- A message that needs a sentence of explanation; use alert
- A count or category tag; use badge

## Alternatives
- [badge](https://hazeui.com/ui/badge.md)
- [alert](https://hazeui.com/ui/alert.md)
- [tag](https://hazeui.com/ui/tag.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| variant | `"default" \| "info" \| "success" \| "warning" \| "destructive"` | "default" | no | Color of the dot. |
| label | `string` |  | yes | State name shown next to the dot. |
| pulse | `boolean` | false | no | For a live state: adds a halo that pings outward behind the dot. |
| class | `string` |  | no | 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.

## Agent prompts

### 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": "https://hazeui.com/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: https://hazeui.com/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.

## Example requests that should lead here
- Show API status as Operational with a green pulsing dot
- List three services with Degraded and Offline states

## Source

```astro
---
import { cn } from "../../../lib/haze/utils";

interface Props {
  variant?: "default" | "info" | "success" | "warning" | "destructive";
  label: string;
  /** For something live: a soft halo pings behind the dot. It is hidden from assistive technology, like the dot. */
  pulse?: boolean;
  class?: string;
}

const { variant = "default", label, pulse = false, class: className } = Astro.props;
const dots = {
  default: "bg-muted-foreground",
  info: "bg-brand",
  success: "bg-success",
  warning: "bg-warning",
  destructive: "bg-destructive",
};
const tones = {
  default: "text-muted-foreground",
  info: "text-brand",
  success: "text-success",
  warning: "text-warning",
  destructive: "text-destructive",
};
---

<span class={cn("inline-flex items-center gap-2 text-[0.8125rem]/5 text-foreground", className)}>
  <span aria-hidden="true" class={cn("relative inline-flex size-2 shrink-0", tones[variant])}>
    {pulse && <span class="absolute inset-0 animate-ping rounded-full bg-current opacity-60"></span>}
    <span class={cn("relative size-2 rounded-full forced-colors:border forced-colors:border-current", dots[variant])}></span>
  </span>
  {label}
</span>
```
