Usage
After setting up the CSS, apply dv-chip to a span and add an appearance class to give the label a surface.
<span class="dv-chip dv-color-success dv-appearance-subtle">Complete</span> Examples
Sizes and status
Medium is the default. Use meaningful status text alongside the palette.
Draft
In review
Complete
<span class="dv-chip dv-chip--sm dv-color-neutral dv-appearance-subtle">Draft</span>
<span class="dv-chip dv-chip--md dv-color-warning dv-appearance-subtle">In review</span>
<span class="dv-chip dv-chip--lg dv-color-success dv-appearance-subtle">Complete</span> Icon and count
Place decorative icons in leading or trailing slots. Min-square gives short labels a minimum width based on their height and grows with the label.
New
3
<span class="dv-chip dv-color-primary dv-appearance-subtle">
<span class="dv-chip__leading"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<path d="M5 12h14M12 5v14" />
</svg></span>
New
</span>
<span class="dv-chip dv-chip--min-square dv-color-primary dv-appearance-solid">3</span> API reference
| Class or attribute | Behavior |
|---|---|
dv-chip | Creates the inline label container. |
dv-chip--smdv-chip--mddv-chip--lg | Select one size. Medium is the default. |
dv-chip__leadingdv-chip__trailing | Optional direct children. Their SVGs use the current icon sizing. |
dv-chip--min-square | Sets minimum inline and block sizes based on line height and block padding. |
dv-color-*dv-appearance-* | Choose a shared palette and appearance independently. |
Customization
Override chip tokens on the label or in a reusable class.
| Property | Effect and defaults |
|---|---|
--dv-chip-gap | Space between the label and slots. Defaults to the space-50 token. |
--dv-chip-radius | Corner radius. Defaults to the small radius token. |
--dv-chip-padding-block / --dv-chip-padding-inline | Padding set by the selected size. |
--dv-icon-size | Overrides SVG dimensions in the slots. |