Skip to Content
DocsResourcesShowcase

Tag

Used for categorizing or labeling content

SourceStorybookRecipe
Plain Tag
Closable Tag

import { Tag } from '@saas-ui/react/tag'
<Tag>Tag here</Tag>

Use the startElement prop to add an icon to the tag.

Tag 2
Top Rated

Use the variant prop to change the appearance of the tag.

Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray

Use the size prop to change the size of the tag.

Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray
Gray

Use the colorPalette prop to change the color of the tag.

gray

Content
Content
Content

red

Content
Content
Content

green

Content
Content
Content

blue

Content
Content
Content

teal

Content
Content
Content

pink

Content
Content
Content

purple

Content
Content
Content

cyan

Content
Content
Content

orange

Content
Content
Content

yellow

Content
Content
Content

Use the closable prop to make the tag closable.

Tag 1
Tag 2

Use the maxWidth prop to control the maximum width of the tag. When the content exceeds this width, it will be truncated with an ellipsis.

This is particularly useful when dealing with dynamic or user-generated content where the length might vary.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam molestias, laboriosam, quod, quia quidem quae voluptatem natus exercitationem autem quibusdam

Here's an example of a tag with an avatar.

JD
Emily (sm)
JD
Emily (md)
JD
Emily (lg)
JD
Emily (xl)

Use the asChild prop to render the tag as a button.

Note that you'll need to import the Tag from @chakra-ui/react to use this prop.

PropDefaultType
colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent'

The color palette of the component

size 'md'
'sm' | 'md' | 'lg'

The size of the component

variant 'surface'
'subtle' | 'solid' | 'outline' | 'surface'

The variant of the component

Previous

Table

Next

Textarea