DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Tag

Used for categorizing or labeling content

  • npm
  • source
  • recipe
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { Tag } from '@cerberus/react'

Usage

You can mix and match all of the examples to create the tag style of your choosing.

Loading example...

Usage Variants

Use the usage prop to change the style of the tag.

Loading example...

Shape Variants

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

Loading example...

Colors

You can set the color of the tag by using the palette prop.

Note

By nature of CSS rules, only a `palette` or `gradient` can be used at a time. This is because the `palette` prop sets the background color, and the `gradient` prop sets the background gradient.

Loading example...

Gradients

You can set the gradient of the tag by using the gradient prop.

Note

By nature of CSS rules, only a `palette` or `gradient` can be used at a time. This is because the `palette` prop sets the background color, and the `gradient` prop sets the background gradient.

Loading example...

Closable

To use a closable tag, just pass an onClick prop to the Tag component. This will create a pill-shaped tag with a close icon button.

Loading example...

Customizing

You can customize the Tag using style props and data selectors on any slot primitve.

Loading example...

Primitives

You can customize the tag by utilizing style props and primitives. A Closable Tag is just a Tag with an IconButton inside.

ComponentDescription
TagRootThe root wrapper of the tag.

Data Attributes

The Primitives additionally use the following data attributes for custom styling:

NameValueDescription
data-scopetagThe scope of the components.
data-partrootThe root wrapper of the tag.
data-palettepalette nameThe color palette of the tag.

API

Props

The Tag component is an abstraction of the primitives and accepts the following props:

NameDefaultDescription
gradientundefinedThe gradient of the tag (overrides palette).
palettepageThe color palette of the tag (overrides gradient).
usagefilledThe style treatment of the tag.
shapepillThe shape of the tag.
onClickundefinedHow to create a Closable tag.

On this page

  • Import
  • Usage
  • Usage Variants
  • Shape Variants
  • Colors
  • Gradients
  • Closable
  • Customizing
  • Primitives
    • Data Attributes
  • API
    • Props
Edit this page on Github
FilledStart iconEnd icon
filledoutlined
pillsquare
page:
Label
Label
Label
Label
info:
Label
Label
Label
Label
success:
Label
Label
Label
Label
warning:
Label
Label
Label
Label
danger:
Label
Label
Label
Label
secondaryAction:
Label
Label
Label
Label
charon-light:
Label
Label
Label
Label
charon-dark:
Label
Label
Label
Label
nyx-light:
Label
Label
Label
Label
nyx-dark:
Label
Label
Label
Label
amphiaraus-light:
Label
Label
Label
Label
amphiaraus-dark:
Label
Label
Label
Label
styx-light:
Label
Label
Label
Label
styx-dark:
Label
Label
Label
Label
thanatos-light:
Label
Label
Label
Label
thanatos-dark:
Label
Label
Label
Label
hades-light:
Label
Label
Label
Label
hades-dark:
Label
Label
Label
Label
asphodel-light:
Label
Label
Label
Label
asphodel-dark:
Label
Label
Label
Label
ClosableClosableClosable
Cerberus Forever