# Badge (`.z-badge`)

> Small pill for counts and short statuses with four semantic color schemes.

- **Kind:** css
- **Category:** general

## CSS Variables

| Variable | Default | Scope | Affects | Description |
| --- | --- | --- | --- | --- |
| `--z-badge-bg` | `var(--z-bg)` | `.z-badge` | `background-color` | Background color of the badge. |
| `--z-badge-bg-o` | `100%` | `.z-badge` | `background-color` | Opacity applied to the background color. |
| `--z-badge-border` | `var(--z-border)` | `.z-badge` | `border-color` | Border color. |
| `--z-badge-border-o` | `var(--z-border-o)` | `.z-badge` | `border-color` | Opacity applied to the border color. |
| `--z-badge-color` | `var(--z-bg-f)` | `.z-badge` | `color` | Text color. |
| `--z-badge-color-o` | `100%` | `.z-badge` | `color` | Opacity applied to the text color. |
| `--z-badge-shadow` | `var(--z-global-shadow)` | `.z-badge` | `box-shadow` | Box shadow; falls back to the global shadow. |

## CSS Classes

| Class | Role | Applies to | Description |
| --- | --- | --- | --- |
| `.z-badge` | `root` | `.z-badge` | Inline pill for counts and short statuses. |
| `.z-badge-danger` | `modifier` | `.z-badge` | Danger color scheme with a faint tinted background. |
| `.z-badge-info` | `modifier` | `.z-badge` | Info color scheme with a faint tinted background. |
| `.z-badge-success` | `modifier` | `.z-badge` | Success color scheme with a faint tinted background. |
| `.z-badge-warning` | `modifier` | `.z-badge` | Warning color scheme with a faint tinted background. |

## Notes

- Hovering fades the badge to 80% opacity with a short background transition.

## Guides

- [Styling with cls and stl](https://next.0build.dev/docs/guides/styling.md)
- [Translating Components](https://next.0build.dev/docs/guides/i18n.md)
- [Icon Resolution](https://next.0build.dev/docs/guides/icons.md)
- [The data-source Convention](https://next.0build.dev/docs/guides/data-source.md)
- [Openers & Triggers](https://next.0build.dev/docs/guides/triggers.md)
- [Dialog Behavior](https://next.0build.dev/docs/guides/dialogs.md)
- [Utilities](https://next.0build.dev/docs/guides/utilities.md)
- [Runtime](https://next.0build.dev/docs/guides/runtime.md)
