Back to Components

Display

Chip

Toggleable filter pill. Pressable when onClick is set; static span otherwise.

Examples

Filter strip

{#each [['epub', 942], ['pdf', 248], ['txt', 14]] as [name, n]}
  <Chip
    active={formats.has(name)}
    onClick={() => toggle(name)}
    count={n}
  >
    {name.toUpperCase()}
  </Chip>
{/each}

Static (non-interactive)

EPUB PDF 4
<Chip>EPUB</Chip>

Props

PropTypeDefaultDescription
activebooleanfalseFilled accent state when true.
countnumberOptional small count after the label.
onClick() => voidWhen set, renders as <button> with hover/focus chrome.
disabledbooleanfalseNative disabled state for interactive chips.
ariaLabelstringAccessible name override.

Install

CLI

npx @a3tai/mittsu add chip