# Status Pill

A compact pill for status and category labels.

A compact, rounded label for status and categories. Choose a semantic intent or named palette with the `color` prop.

```tsx
import { StatusPill, Stack } from "@zentara-co/zenos-ui";

function StatusPillPreviewExample() {
  return (
    <Stack direction="row" gap="2" align="center" wrap="wrap" className="justify-center">
      <StatusPill color="green">Active</StatusPill>
      <StatusPill color="yellow">Pending</StatusPill>
      <StatusPill color="red">Blocked</StatusPill>
    </Stack>
  );
}
```

## Import

```tsx
import { StatusPill, type StatusPillColor } from "@zentara-co/zenos-ui";
```

## Colors

StatusPill uses a consistent rounded shape, tinted fill, and bold uppercase presentation. Choose the palette with `color`; its default is `neutral`. It does not have Badge's appearance `variant` prop.

The supported colors match [Badge](/components/badge/): `neutral`, `brand`, `danger`, `warning`, `information`, `success`, `gray`, `red`, `orange`, `yellow`, `lime`, `green`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `purple`, and `pink`.

```tsx
import { StatusPill, Stack } from "@zentara-co/zenos-ui";

const badgeColors = [
  "neutral",
  "brand",
  "danger",
  "warning",
  "information",
  "success",
  "gray",
  "red",
  "orange",
  "yellow",
  "lime",
  "green",
  "teal",
  "cyan",
  "sky",
  "blue",
  "indigo",
  "purple",
  "pink",
] as const;

function StatusPillColorsExample() {
  return (
    <Stack direction="row" gap="2" align="center" wrap="wrap">
      {badgeColors.map((color) => (
        <StatusPill key={color} color={color}>
          {color}
        </StatusPill>
      ))}
    </Stack>
  );
}
```

## Shape

StatusPill defaults to fully rounded corners (`rounded={true}`). Set `rounded={false}` for regular corners without changing the color or uppercase treatment. Custom classes can still override the corner radius.

```tsx
import { StatusPill, Stack } from "@zentara-co/zenos-ui";

function StatusPillShapeExample() {
  return (
    <Stack direction="row" gap="2" align="center" wrap="wrap">
      <StatusPill color="success" rounded={false}>
        Regular corners
      </StatusPill>
      <StatusPill color="success" rounded>
        Fully rounded
      </StatusPill>
    </Stack>
  );
}
```

## With icons

Use `StatusPill.Icon` for a decorative icon, and keep the status meaning in the text. `StatusPill.Root` is an alias for `StatusPill`.

```tsx
import { CheckCircleIcon } from "@phosphor-icons/react";
import { StatusPill } from "@zentara-co/zenos-ui";

function StatusPillIconExample() {
  return (
    <StatusPill color="success">
      <StatusPill.Icon>
        <CheckCircleIcon />
      </StatusPill.Icon>
      Verified
    </StatusPill>
  );
}
```

## As a link

Use `render={<a href="…" />}` for a status or category label that navigates to related content. StatusPill renders that anchor instead of a wrapping span, keeping its `color`, `rounded`, custom styling, hover feedback, and visible keyboard focus ring. Without `render`, `StatusPill` and `StatusPill.Root` remain noninteractive spans.

```tsx
import { CheckCircleIcon } from "@phosphor-icons/react";
import { StatusPill, Stack } from "@zentara-co/zenos-ui";

function StatusPillLinkExample() {
  return (
    <Stack direction="row" gap="2" align="center" wrap="wrap">
      <StatusPill render={<a href="/components/status-pill/#colors" />} color="success">
        <StatusPill.Icon>
          <CheckCircleIcon />
        </StatusPill.Icon>
        View colors
      </StatusPill>
      <StatusPill
        render={<a href="/components/status-pill/#shape" />}
        color="information"
        rounded={false}
      >
        View shapes
      </StatusPill>
    </Stack>
  );
}
```

Put native anchor props such as `href`, `target`, `rel`, `download`, and `aria-current` on the element passed to `render`. Base UI merges its classes, styles, event handlers, and ref with StatusPill's props. `StatusPill.Icon` also works inside links. For a new tab, pair `target="_blank"` with `rel="noopener noreferrer"` and make that behavior clear in the link text.

Your router's link component can also be passed through `render` if it forwards props and its ref to an anchor. For a render callback, spread the supplied props onto the element you return so styling, accessibility attributes, and refs are preserved.

## Custom styling

Use the usual `className` prop for your own appearance without supplying `color` or `rounded`. Your classes apply after the built-in styling and override conflicting background, border, foreground, shape, spacing, and typography. Native `style` props are also forwarded. Prefer semantic tokens for theme-aware colors.

```tsx
import { StatusPill } from "@zentara-co/zenos-ui";

function CustomStatusPillExample() {
  return (
    <StatusPill className="rounded-md border-transparent bg-background-information-default px-3 font-medium normal-case text-text-information-bolder">
      In review
    </StatusPill>
  );
}
```

Share a class string or an application CSS class to reuse an appearance. The same approach works with `render` links. Layout-only classes keep the default appearance, and `color` remains an optional convenience for built-in palettes.

## Anatomy

```text
StatusPill
StatusPill.Root
StatusPill.Link
StatusPill.Icon
```

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| className | string | — | Custom styling and instance overrides. No color or rounded prop is required. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Replace the default span with an anchor or router link. Base UI merges props, handlers, and refs. |
| rounded | boolean | true | Fully rounded corners when true; regular corners when false. |
| color | StatusPillColor | neutral | Semantic intent or named color palette, independent of appearance. |
| native props | React.HTMLAttributes<HTMLSpanElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
| href | string | — | Navigation destination on the anchor passed to render. Also supported by StatusPill.Link. |
| anchor props | AnchorHTMLAttributes<HTMLAnchorElement> | — | StatusPill.Link forwards native anchor attributes and an HTMLAnchorElement ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

StatusPill is a native `span` by default and does not add interaction or automatic live announcements. Use `render` with an anchor and an `href` for navigation, keeping its keyboard focus indicator visible and its link text descriptive. Do not nest interactive elements inside a link or use either form as a substitute for a button, filter, or selectable control. Explain status through text rather than color alone; opt into `role="status"` on a noninteractive label only for updates that need a polite live announcement.

Source: https://zenos-ui.pages.dev/components/status-pill/