Tag

Updated: Oct 25, 2026
Tag is a small, static label — one short line of text on a rounded, blended surface. Use it to mark or qualify adjacent content, such as a “Beta” marker after a title. It owns its padding, its text style, its corner geometry, and the blend that lets it sit over varied backgrounds.
A tag is never interactive and never a heading, a section label, or a field background. Keep the copy to a word or two and let it render at its intrinsic size.
Tag is built on StaticContainer, so it has no interaction states and inherits that component’s material, shape, and sizing contract.
Two related components are easy to confuse: Chip is the compact state or identity element that can carry an avatar, icon, or loading state, and both Button and ListItem render a built-in tag of their own through a trailingTag prop, whose label comes from the closed TrailingTag enum — you do not place a Tag inside either of them yourself.

Usage

import { Tag, TextStyle, TextView } from '@wearables-ui-toolkit/mrbd';

export function SectionTitle({ title }: { title: string }) {
  return (
    <div className="section-title">
      <TextView textStyle={TextStyle.HEADING2}>{title}</TextView>
      <Tag text="Beta" />
    </div>
  );
}
.section-title {
  display: flex;
  align-items: center;
  gap: var(--uit-spacing-small);
}
Tags size to their content, so in a flex column the default cross-axis stretch would turn them into full-width bars. Align them to the start:
.metadata-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--uit-spacing-xsmall);
}
Render nothing rather than an empty tag when there is no qualifier to show:
{feature.qualifier != null ? <Tag text={feature.qualifier} /> : null}
Use contentStyle for caller content padding and style for outer placement or composition. Tag keeps its whole-layer screen blending on the root; its text inset belongs to the shared content layout.

Props

The full prop type is TagProps. It extends StaticContainerProps with children omitted — the copy comes from text.

Own props

PropTypeDefaultDescription
text
string
—
The label copy. Nothing is rendered inside the tag when it is empty or omitted; the material still paints.

Notable inherited props

See StaticContainer for the full inherited surface.
PropTypeDefaultDescription
material
ContainerMaterial
the default static material
Material used for the background and stroke layers.
shapeProvider
ShapeProvider
the default shape provider
Geometry used for clipping and every material path.
backgroundStyle
BackgroundStyle
BackgroundStyle.PRIMARY
Whether the material renders and in which treatment. NONE hides it; SECONDARY swaps in the secondary static material.
visualState
VisualState
VisualState.DEFAULT
Static visual state handed to the material. It adds no interaction behavior.
width
number \| string
'auto'
Explicit width. Leave it unset so the tag sizes to its content.
height
number \| string
'auto'
Explicit height. Leave it unset.
contentClip
'shape' \| 'bounds' \| 'none'
'shape'
Clips the text to the tag’s shape.
useSmoothCorners
boolean
true
Render smooth (squircle) corners once the tag has been measured.
contentClassName
string
''
Extra class on the inner content wrapper.
className
string
''
Extra class appended to the tag’s own root class.
style
ContainerRootStyle
—
Outer placement and whole-tag composition, without content padding.
contentStyle
ContainerContentStyle
—
Content layout and padding styles, merged over the tag’s defaults.
Standard div attributes — including data-*, aria-*, role, and event handlers — are forwarded to the root element, and ref resolves to that root div.

Behavior

Layout and sizing. The tag is an inline-flex box that sizes to its content in both axes. Its content layout owns the horizontal and vertical padding; the root has no padding or border width. The material and content clip still surround the whole padded label.
Text. The copy uses the uit-text-meta3 appearance in --uit-color-text-primary, on a single line that never wraps, truncates, or shows an ellipsis. Long copy therefore makes the tag wider instead of clipping; keep it short.
Empty state. An empty or omitted text renders the material with no inner text element. Prefer conditionally rendering the tag over passing an empty string.
Blending. The whole tag layer composites with a screen blend, so it reads clearly over the content behind it without over-brightening on the additive light display.
Corners. Corners come from the shape provider. The tag paints smooth (squircle) corners once it has been measured, and falls back to the equivalent plain border radius for the frames before measurement is available. Content clips at the outer shape, including the tag’s padding; the text has no separate rounded clip.
No interaction states. Because the tag has no interaction behavior, it never renders a focus or press treatment, never takes a tab stop, and never animates between states. Passing an onClick handler forwards the DOM event but does not make the tag keyboard-operable.

Accessibility

  • The tag’s text is ordinary visible content in a plain text element, and is announced as such. Tag sets no role, no accessible name, and no tabIndex of its own.
  • When the tag only reinforces the element next to it, consider whether that element’s accessible name should carry the qualifier instead, so it is not announced as a separate, context-free word.
  • Never rely on the tag’s blended appearance alone to convey status; the word itself has to carry the meaning.
  • Keep the copy to one or two words.
  • Let the tag size itself and sit beside the content it qualifies.
  • Align tags to the start of a flex column so they keep their intrinsic width.
  • Use the trailingTag prop that Button and ListItem already provide instead of placing a Tag inside them.

Avoid

  • Let the tag keep its intrinsic size. Stretching it across a row makes it read as a field background.
  • Use Tag rather than imitating it with a custom rounded rectangle. Its padding and text treatment are component-owned.
  • Avoid placing a tag inside Container, StaticContainer, or Surface.
  • Avoid passing children; the type omits them and only text is rendered.
  • Avoid making a tag interactive; use Button or Chip when the element needs to do something or represent live state.