Tag
Tags mission is to label, categorize, or organize items using keywords that describe them.
Filled Tags
Filled/Contained is the default style for the tags.
Default
Primary
Secondary
Success
Error
Warning
Info
Outlined Tags
Outlined tags offer an alternative style.
Default
Primary
Secondary
Success
Error
Warning
Info
With Leading Icon
Tag components can contain an icon. This is done by setting the icon
property.
Filled
Outlined
Denser
To have denser tags, use the dense
property.
Default
Primary
Secondary
Success
Error
Warning
Info
Removable Tags
To have removable tags, assign a callback to the onRemove
property.
Default
Primary
Secondary
Success
Error
Warning
Info
API
Learn more about the properties and the customization points.
Usage
import Tag from "@sonnat/ui/Tag";//orimport { Tag } from "@sonnat/ui";
Properties
Note that the documentation avoids mentioning all the native props (there are a lot) in this section of the components.
Name | Type | Default | Description |
---|---|---|---|
label required | string | - | The content of the tag. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
variant | "filled" | "outlined" | "filled" | The variant of the tag. |
color | "default" | "primary" | "secondary" | "success" | "error" | "warning" | "info" | "filled" | The color of the tag. |
icon | node | - | The leading icon element placed before the label. |
dense | boolean | false | If true , will make the tag denser. |
onRemove | function | - | The callback fires when the tag's remove button is clicked. Signature: function(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void |
|