Chip
Compact inputs, attributes or actions.
When to use
Use a chip for an attribute, selected filter, removable input or compact action. Tags and pills are contextual names; use a Badge for a passive count or status.
Default
Accessibility
<span class="chip">Accessibility</span>Solid
PrimarySecondarySuccessWarningError
<span class="chip chip-primary chip-solid">
<span class="chip-label">Primary</span>
</span>Outline
Primary outline
<span class="chip chip-primary chip-outline">
<span class="chip-label">Primary outline</span>
</span>Text
Primary text
<span class="chip chip-primary chip-text">
<span class="chip-label">Primary text</span>
</span>Interactive
Use native links or buttons for interactive chips. Reserve .chip-interactive for custom controls with equivalent keyboard behavior.
<button class="chip chip-primary chip-outline" type="button">
<span class="chip-label">Filter by accessibility</span>
</button>Deletable
Accessibility
<span class="chip chip-primary chip-solid">
<span class="chip-label">Accessibility</span>
<button class="chip-action" type="button" aria-label="Remove Accessibility filter">
<Icon size="sm" aria-hidden="true">
<CircleXmarkSolidIcon />
</Icon>
</button>
</span>Disabled
Accessibility
<div class="chip chip-primary chip-solid disabled">
<span class="chip-label">Accessibility</span>
</div>Accessibility and behavior
- Choose native links for navigation and buttons for commands. A styled span remains passive; interactive classes alone do not add keyboard behavior.
- Name remove buttons with the affected value, such as
Remove Accessibility filter. After removal, move focus to an appropriate remaining control. - For toggle buttons, synchronize
aria-pressedwith the application state. Use nativedisabledon unavailable buttons; visual disabled classes do not prevent activation.
CSS variables
--action-color* styles interactive primary text and outlines; theme tokens style passive and solid chips.
Override these base defaults on the listed selector after the library styles. Variants and states may replace them; global tokens follow the active theme.
| Token | Default | Purpose | Scope / state |
|---|---|---|---|
--chip-color | var(--primary) | Text and border color for outline and text variants. | .chip-outline / .chip-text |
--chip-color-hover | var(--primary-hover) | Text color on hover for interactive text chips. | .chip-outline / .chip-text |
--chip-color-active | var(--primary-active) | Text color on pressed or active text chips. | .chip-outline / .chip-text |
--chip-on-color | var(--on-primary) | Text and icon color on filled surfaces. | .chip-solid / .chip-outline |
--chip-surface-color | var(--chip-color) | Background and border color for solid chips. | .chip-solid / .chip-outline |
--chip-surface-color-hover | var(--chip-color-hover) | Filled background and border color on hover. | .chip-solid / .chip-outline |
--chip-surface-color-active | var(--chip-color-active) | Filled background and border color when pressed or marked active. | .chip-solid / .chip-outline |
--chip-font-size | var(--font-size-sm) | Text size. | .chip |
--chip-padding-y | var(--spacer-0) | Top and bottom padding. | .chip |
--chip-padding-x | var(--spacer-2) | Left and right padding. | .chip |
--chip-border-radius | 9999px | Corner radius. | .chip |
--chip-border-width | var(--border-width) | Border thickness. | .chip |
--chip-action-size | 1.5rem | Width and height of the trailing action. | .chip |
--chip-highlight | var(--bg-highlight) | Hover and active background of interactive text chips. | .chip: interactive hover / .chip-text active |
--chip-disabled-text-color | var(--disabled-text-color) | Text color while disabled. | .chip (disabled) |
--chip-disabled-bg-color | var(--disabled-bg-color) | Background color while disabled. | .chip (disabled) |
--chip-disabled-border-color | var(--disabled-border-color) | Border color while disabled. | .chip (disabled) |
--chip-transition-duration | var(--transition-duration) | Duration of visual state transitions. | .chip |
--chip-transition-easing | var(--transition-easing) | Timing curve for visual state transitions. | .chip |