Badge component
Properties
| Name | Description | Default |
|---|---|---|
| contained | Display type of the badge. Default is true. | - |
| ghost | Should the badge have a ghost style on default state | - |
| icon | Icon appended before Badge content. | - |
| iconAfter | Icon appended after Badge content. Only visible when forwardedAs is set. | - |
| iconColor | Custom color of the icon | - |
| iconVisible | Should the appended icon be visible at all times | - |
| size | Badge size | - |
| truncate | Should the badge truncate text to fit the parent container width. Note: The Badge element will be displayed as a flex container, not inline flex, to allow truncation. @see {@link https://sema4ai-design-system.pages.dev/data-display/badge#truncate} | - |
| variant | Badge color style type, defaults to | - |
Variants
Badge is available in two subsets of semantically and color named variants with overlapping visual style.
Semantic Variants
Color Variants
Interactive
Badge can be used as an interactive element by defining the `forwardedAs` property
With Icon
An icon can be prepended or appended to the badge content. If required, a custom color can be defined via the `iconColor` prop.
Truncate
The `truncate` property can be used to truncate the Badge label to fit the parent container width.