Tag
Tags present static metadata or contextual information. They provide a fixed visual treatment, making them ideal for displaying system-defined values, attributes, or informational labels.
import {Tag} from "@qualcomm-ui/react/tag"Examples
Icons
Icons are supplied using the startIcon and endIcon props.
LabelLabel
<Tag emphasis="neutral" startIcon={Plus}>
Label
</Tag>
<Tag emphasis="neutral" endIcon={Plus}>
Label
</Tag>
Variants
Choose from three variants: link, selectable and dismissable.
dismissable
<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.
<Tag emphasis="outline-brand" startIcon={Smile} variant="selectable">
outline-brand
</Tag>
<Tag emphasis="outline-neutral" startIcon={Smile} variant="selectable">
outline-neutral
</Tag>
<Tag emphasis="neutral" startIcon={Smile} variant="selectable">
neutral
</Tag>
<Tag emphasis="blue" startIcon={Smile} variant="selectable">
blue
</Tag>
<Tag emphasis="cyan" startIcon={Smile} variant="selectable">
cyan
</Tag>
<Tag emphasis="teal" startIcon={Smile} variant="selectable">
teal
</Tag>
<Tag emphasis="green" startIcon={Smile} variant="selectable">
green
</Tag>
<Tag emphasis="kiwi" startIcon={Smile} variant="selectable">
kiwi
</Tag>
<Tag emphasis="yellow" startIcon={Smile} variant="selectable">
yellow
</Tag>
<Tag emphasis="orange" startIcon={Smile} variant="selectable">
orange
</Tag>
<Tag emphasis="red" startIcon={Smile} variant="selectable">
red
</Tag>
<Tag emphasis="magenta" startIcon={Smile} variant="selectable">
magenta
</Tag>
<Tag emphasis="purple" startIcon={Smile} variant="selectable">
purple
</Tag>
Sizes
Choose from three sizes: sm, md and lg. The default size is md.
LabelLabelLabel
<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.
LabelLabel
<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.
LabelLabel
<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. | | 'outline-brand' | 'outline-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 | |
() => void | ||
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
| 'outline-brand'
| 'outline-neutral'
| 'neutral'
| 'blue'
| 'cyan'
| 'teal'
| 'green'
| 'kiwi'
| 'yellow'
| 'orange'
| 'red'
| 'magenta'
| 'purple'
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
() => void
Description
Callback fired when the dismiss button is clicked. Only applicable when
variant is
dismissable.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.
{className: 'qui-tag__root'; data-disabled: ''; data-emphasis: 'outline-brand' | 'outline-neutral' | 'neutral' | 'blue' | 'cyan' | 'teal' | 'green' | 'kiwi' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple'; data-part: 'root'; data-radius: 'square' | 'rounded'; data-scope: 'tag'; data-size: 'sm' | 'md' | 'lg'; data-variant?: 'link' | 'selectable' | 'dismissable';} | {className: 'qui-tag__root'; data-disabled: ''; data-emphasis: 'outline-brand' | 'outline-neutral' | 'neutral' | 'blue' | 'cyan' | 'teal' | 'green' | 'kiwi' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple'; data-part: 'root'; data-radius: 'square' | 'rounded'; data-scope: 'tag'; data-size: 'sm' | 'md' | 'lg'; data-variant?: 'link' | 'selectable' | 'dismissable'; disabled: boolean;}
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'