Tag

import {Tag} from "@qualcomm-ui/react/tag"

Examples

Icons

Icons are supplied using the startIcon and endIcon props.

<Tag emphasis="neutral" startIcon={Plus}>
  Label
</Tag>
<Tag emphasis="neutral" endIcon={Plus}>
  Label
</Tag>

Variants

Choose from three variants: link, selectable and 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="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.

<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.

<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.

<Tag radius="square">Label</Tag>
<Tag radius="rounded">Label</Tag>

API

<Tag>

PropTypeDefault
React children prop.
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'
| 'outline-neutral'
| 'neutral'
'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
| ReactNode
Governs the shape of the tag.
| 'square'
| 'rounded'
'square'
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Governs the size of the text, icons, spacing, and padding.
| 'sm'
| 'md'
| 'lg'
'md'
lucide-react icon, positioned before the button text. Can be supplied as a ReactElement for additional customization.
| LucideIcon
| ReactNode
Governs the interactive style of the tag.
| 'link'
| 'selectable'
| 'dismissable'
Description
React children prop.
Type
boolean
Description
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.

StartIcon

EndIcon

Note that the endIcon prop is ignored when variant is dismissible.