Tag
Tag is used when items need to be labelled, categorized, and organized using keywords that describe them.
Imports
- Tag Standalone tag component
- TagGroup Used to group related tags together in a horizontal stack.
Usage
Tag Variants
Tag has 4 variants primary
secondary
outline
ghost
You can add extra variants & sizes via the theme file. Checkout theming guide.
Tag Sizes
Tag comes with 3 sizes sm
md
lg
Closable Tag
Tags can be closable or removable. If closable
prop is passed tag will show a
close icon in the suffix.
Tag Prefix/Suffix
Same as buttons Tag also accepts prefix, suffix props which can be used to append or prepend content in the tag.
closable
is set to true
TagGroup
TagGroup can be used to group multiple tags together & can pass down size
,
variant
props.
While using TagGroup, we will add roving index to the closable icons that means you can move the focus with the arrow keys.
To disable roving index on the tag closable icons you can set
allowArrowNavigation=false
API Reference
Tag Props
Prop | Type | Default |
---|---|---|
id | string | - |
size | union | md |
variant | union | primary |
closable | Boolean | false |
onClose | Function | - |
prefix | React.ReactElement | - |
suffix | React.ReactElement | <CloseIcon /> |
TagGroup Props
Prop | Type | Default |
---|---|---|
size | union | md |
variant | union | primary |
allowArrowNavigation | Boolean | true |