Skip to main content

What are you looking for?

Try searching for…

Components

Tag

Tag is a label that can be used to categorize items or communicate progress, status, or process. Tags can provide users with a quicker overview of content.

HTML

Press Enter to start editing
Unable to parse html
const Preview = () => {
  return <Tag>New</Tag>;
};

render(<Preview />)

Usage

Apply the class name ds-tag to the element that should be a tag. You can set variant="outline" to add an outline to the tag.

CSS variables and data attributes

Size is controlled with data-size and color with data-color. The component inherits these from the closest parent where they are set.

CSS Variables
NameValue
--dsc-tag-backgroundvar(--ds-color-surface-tinted)
--dsc-tag-colorvar(--ds-color-text-default)
--dsc-tag-min-heightvar(--ds-size-8)
--dsc-tag-padding0 var(--ds-size-2)
--dsc-tag-border-widthvar(--ds-border-width-default)
--dsc-tag-border-colortransparent
--dsc-tag-border-stylesolid
Data Attributes
NameValue
data-variantoutline

React

variant
Description

The visual variant of the tag

Type
"default" | "outline"
Default
default
NameTypeDefaultDescription
variant"default" | "outline"default

The visual variant of the tag

Edit this page on github.com (opens in a new tab)