# Tag (`.z-tag`)

> Compact label chips with status color variants, used standalone or inside the tag input.

- **Kind:** css
- **Category:** content

## CSS Variables

| Variable | Default | Scope | Affects | Description |
| --- | --- | --- | --- | --- |
| `--z-tag-bg` | `transparent` | `.z-tag` | `background-color` | Background base color, mixed with transparency using `--z-tag-bg-o`. |
| `--z-tag-bg-o` | `0%` | `.z-tag` | `background-color` | Background opacity percentage used in the mix. |
| `--z-tag-color` | `var(--z-bg-f)` | `.z-tag` | `color` | Text base color, mixed with transparency using `--z-tag-color-o`. |
| `--z-tag-color-o` | `100%` | `.z-tag` | `color` | Text opacity percentage used in the mix. |
| `--z-tag-font-size` | `var(--z-global-font-size-small)` | `.z-tag` | `font-size` | Font size of the tag text. |
| `--z-tag-gap` | `0.5rem` | `.z-tag` | `gap` | Gap between tag content (text, icons, remove button). |
| `--z-tag-height` | `1.75rem` | `.z-tag` | `min-height` | Minimum height of the tag. |
| `--z-tag-hover-duration` | `150ms` | `.z-tag` | `transition-duration` | Duration of the hover transition. |
| `--z-tag-hover-opacity` | `0.8` | `.z-tag` | `opacity` | Opacity applied while hovered. |
| `--z-tag-line-height` | `var(--z-global-line-height-small)` | `.z-tag` | `line-height` | Line height of the tag text. |
| `--z-tag-padding` | `0.25rem 0.5rem` | `.z-tag` | `padding` | Inner padding of the tag. |
| `--z-tag-radius` | `var(--z-global-radius-small)` | `.z-tag` | `border-radius` | Corner radius of the tag. |

## CSS Classes

| Class | Role | Applies to | Description |
| --- | --- | --- | --- |
| `.z-tag` | `root` | `.z-tag` | Root class of the tag chip. |
| `.z-tag-danger` | `modifier` | `.z-tag` | Danger color variant. |
| `.z-tag-info` | `modifier` | `.z-tag` | Info color variant. |
| `.z-tag-muted` | `modifier` | `.z-tag` | Muted color variant. |
| `.z-tag-primary` | `modifier` | `.z-tag` | Primary color variant. |
| `.z-tag-secondary` | `modifier` | `.z-tag` | Secondary color variant. |
| `.z-tag-success` | `modifier` | `.z-tag` | Success color variant. |
| `.z-tag-warning` | `modifier` | `.z-tag` | Warning color variant. |

## Notes

- Tag is a CSS layer; `z-input-tag` renders its chips with `.z-tag z-tag-secondary` by default.

## 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)

## Related

- [Tag Input](https://next.0build.dev/docs/components/input-tag.md)
- [Badge](https://next.0build.dev/docs/components/badge.md)
