Component Porchlight CSS

Chip

Compact tag/pill with optional remove button. Uses relative color syntax for derived tints.

52 components 51 stable 1 experimental

Command

Search Porchlight

Chip

The .c-chip is a compact tag/pill with an optional remove button. Default tone uses relative color syntax (oklch(from var(--pl-color-accent) ...)) to derive a tinted background from the accent token. Falls back to color-mix() where relative color syntax is unsupported.

Semantic HTML

<!-- Static chip -->
<span class="c-chip">Label</span>

<!-- Removable chip -->
<span class="c-chip" data-tone="success">
  Active
  <button class="c-chip__remove" aria-label="Remove">x</button>
</span>

<!-- Group -->
<div class="c-chip-group">
  <span class="c-chip">Tag 1</span>
  <span class="c-chip">Tag 2</span>
</div>

Class contract

SelectorRole
.c-chipThe pill (inline-flex).
.c-chip__removeOptional remove button.
.c-chip-groupWrapping flex container.
[data-tone]success, warning, danger (default = accent).
[data-size]sm (default = normal).