Tag
import {Tag} from "@qualcomm-ui/react/tag"Examples
Icons
Icons are supplied using the startIcon and endIcon props.
Qualcomm
<Tag emphasis="neutral" startIcon={Plus}>
Label
</Tag>
<Tag emphasis="neutral" endIcon={Plus}>
Label
</Tag>Variants
Choose from three variants: link, selectable and dismissable.
Qualcomm
<Tag endIcon={Link2} variant="link">
link
</Tag>
<Tag variant="selectable">selectable</Tag>
<Tag variant="dismissable">dismissable</Tag>Colors
Control the visual emphasis with different colors via the emphasis prop.
Qualcomm
<Tag emphasis="brand">Label</Tag>
<Tag emphasis="outline-neutral">Label</Tag>
<Tag emphasis="neutral">Label</Tag>Sizes
Choose from three sizes: sm, md and lg. The default size is md.
Qualcomm
<Tag size="sm" variant="dismissable">
Label
</Tag>
<Tag size="md" variant="dismissable">
Label
</Tag>
<Tag size="lg" variant="dismissable">
Label
</Tag>States
Disable the tag by setting the disabled prop.
Qualcomm
<Tag variant="dismissable">Label</Tag>
<Tag disabled variant="dismissable">
Label
</Tag>Radius
Control the border radius of the tag with the radius prop. The default radius is square.
Qualcomm
<Tag radius="square">Label</Tag>
<Tag radius="rounded">Label</Tag>API
<Tag>
| Prop | Type | Default |
|---|---|---|
Controls the component's interactivity. If true, the component becomes
unresponsive to input and is visually dimmed to indicate its disabled state. | boolean | |
Governs the color of the tag. | | 'brand' | 'brand' |
lucide-react icon, positioned after
the button text. Can be supplied as a ReactElement for additional
customization. Note that this prop is ignored if variant is
dismissable, as it is reserved for the dismiss icon. | | LucideIcon | |
Governs the shape of the tag. | | 'square' | 'square' |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement | |
Governs the size of the text, icons, spacing, and padding. | | 'sm' | 'md' |
lucide-react icon, positioned before
the button text. Can be supplied as a ReactElement for additional
customization. | | LucideIcon | |
Governs the interactive style of the tag. | | 'link' |
Type
booleanDescription
Controls the component's interactivity. If
true, the component becomes
unresponsive to input and is visually dimmed to indicate its disabled state.Type
| 'brand'
| 'outline-neutral'
| 'neutral'
Description
Governs the color of the tag.
Type
| LucideIcon
| ReactNode
Description
lucide-react icon, positioned after
the button text. Can be supplied as a
ReactElement for additional
customization. Note that this prop is ignored if variant is
dismissable, as it is reserved for the dismiss icon.Type
| 'square'
| 'rounded'
Description
Governs the shape of the tag.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
Governs the size of the text, icons, spacing, and padding.
Type
| LucideIcon
| ReactNode
Description
lucide-react icon, positioned before
the button text. Can be supplied as a
ReactElement for additional
customization.Type
| 'link'
| 'selectable'
| 'dismissable'
Description
Governs the interactive style of the tag.
| Attribute / Property | Value |
|---|---|
className | 'qui-tag__root' |
data-disabled | |
data-emphasis | | 'brand' |
data-part | 'root' |
data-radius | | 'square' |
data-scope | 'tag' |
data-size | | 'sm' |
data-variant | | 'link' |
classNameValue
'qui-tag__root'data-disabledValue
data-emphasisValue
| 'brand'
| 'outline-neutral'
| 'neutral'
data-partValue
'root'data-radiusValue
| 'square'
| 'rounded'
data-scopeValue
'tag'data-sizeValue
| 'sm'
| 'md'
| 'lg'
data-variantValue
| 'link'
| 'selectable'
| 'dismissable'
StartIcon
| Attribute / Property | Value |
|---|---|
className | 'qui-tag__icon' |
data-part | 'start-icon' |
data-scope | 'tag' |
data-size | | 'sm' |
classNameValue
'qui-tag__icon'data-partValue
'start-icon'data-scopeValue
'tag'data-sizeValue
| 'sm'
| 'md'
| 'lg'
EndIcon
Note that the endIcon prop is ignored when variant is dismissible.
| Attribute / Property | Value |
|---|---|
className | 'qui-tag__icon' |
data-part | 'end-icon' |
data-scope | 'tag' |
data-size | | 'sm' |
classNameValue
'qui-tag__icon'data-partValue
'end-icon'data-scopeValue
'tag'data-sizeValue
| 'sm'
| 'md'
| 'lg'