<cs-tag>
StableFeedbackSince 0.1

Tags label, categorize, or represent selections with a compact visual marker. Use them for status indicators, filters, or removable chips.

Featured
Featured

Examples

Variant

Set the variant attribute to match the tag to its meaning.

Brand Success Neutral Warning Danger

Appearance

Use the appearance attribute to change the tag’s visual style. The default is filled-outlined.

Accent Filled-Outlined Filled Outlined

Accent Filled-Outlined Filled Outlined

Accent Filled-Outlined Filled Outlined

Accent Filled-Outlined Filled Outlined

Accent Filled-Outlined Filled Outlined

Size

Use the size attribute to change a tag’s size.

Extra Small Small Medium Large Extra Large

Pill

Use the pill attribute to give tags rounded edges.

Extra Small Small Medium Large Extra Large

Removable

Use the with-remove attribute to add a remove button to the tag. The button carries a built-in Remove label for assistive technology, and activating it emits the cs-remove event so you can handle the removal.

Extra Small Small Medium Large Extra Large

API

Importing

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick this component, use one of the following snippets.

npm Self-Hosted React
import '@cruglobal/cornerstone-components/components/tag/tag.js';
import './cornerstone/components/tag/tag.js';
import CsTag from '@cruglobal/cornerstone-components/react/tag/index.js';

Slots

Learn more about using slots.

NameDescription
(default)The tag's content.

Attributes & Properties

Learn more about attributes and properties.

PropertyAttributeDescriptionTypeDefaultReflects
appearanceappearanceThe tag's visual appearance.'accent' | 'filled' | 'outlined' | 'filled-outlined''filled-outlined'Yes
pillpillDraws a pill-style tag with rounded edges.booleanfalseYes
sizesizeThe tag's size.'xs' | 's' | 'm' | 'l' | 'xl''m'Yes
variantvariantThe tag's theme variant. Defaults to neutral if not within another element with a variant.'brand' | 'neutral' | 'highlight' | 'information' | 'success' | 'warning' | 'danger''neutral'Yes
withRemovewith-removeMakes the tag removable and shows a remove button.booleanfalse

Events

Learn more about events.

NameDescription
cs-removeEmitted when the remove button is activated.

CSS Parts

Learn more about CSS parts.

NameDescriptionCSS selector
contentThe tag's content.::part(content)
remove-buttonThe tag's remove button, a <cs-button>.::part(remove-button)
remove-button__buttonThe remove button's exported button part.::part(remove-button__button)

Dependencies

This component automatically imports the following elements. Sub-dependencies, if any exist, are included in this list.