Tag
A label for classifying or filtering content—categories, applied filters, keywords. Unlike the Badge, it’s designed to be interactive: clickable (is-clickable) and/or dismissible (data-ts-dismissible), with a prefix, sizes, and shapes.
Feedback and status · TaishoDS Core, in plain HTML.
Examples
One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.
Dismissible tags
Static tag
Clickable tag
Class reference
Every value of each modifier, with its HTML ready to copy.
Size
Tag size: sm, md, or lg.
Shape
default or pill (fully rounded).
Variant
The status color: default, success, warning, info, or danger.
Density
Inner spacing: compact or comfortable.
States
is-clickable when the tag triggers an action.
Combinations
Size, shape, and color combined.
When to use
- Representing applied filters the user can remove one by one.
- Listing keywords or categories people can click to navigate or filter.
- The user adds and removes items from a set.
When not to use
- It’s purely informational and nobody will click it →
badge. - It’s the screen’s primary action →
button. - It’s a choice between a few mutually exclusive options →
segmented-control.
Do
- If it’s dismissible, removing it should have an immediate, visible effect.
- Keep labels short. Tags are read as a group, not one by one.
Don’t
- Don’t make a tag clickable if it leads nowhere. It promises something it doesn’t deliver.
- Don’t mix interactive tags with informational labels in the same row → use
badgefor those.
Related
TaishoDS Core
Needs Core’s JS, which hooks in through data-ts-* attributes.
It’s dismissible and responds to the keyboard.
Core hooks into it through these attributes. They go in the markup, and there’s nothing to initialize.
data-ts-dismissdata-ts-dismissible
What it does: Removes the tag on click or Backspace and notifies the container. An is-clickable tag also responds to Enter and Space, with the same click as a button.
From the CDN, without a build, load taisho.tag.css along with taisho.base.css. Also load:
taisho.button.csstaisho.icon.csstaisho.spinner.css
For how Core works in general, see Behavior.
Accessibility
- An
is-clickabletag is keyboard operable (Enter/Space). - The close button (
data-ts-dismiss) has its ownaria-label.
Keyboard
On top of what the browser already does (Tab moves focus, Enter activates a button).
| Key | What it does |
|---|---|
| Enter/Space | Activates the remove button, when the tag is removable. |
Verification
What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.
- axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
- keyboard Key map documented above, checked against the component.
- screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.