Skip to content
nexubDesign System
v12.7.0

Components · Labels & Badges

Chip

StableAdded v0.0.1

Compact label chip, optionally dismissible.

import { Chip } from '@nexub/react';
View as Markdown

Playground

Props

size
DesignEngineeringProduct
TSX
<Chip key={c}>…</Chip>

Examples

Default

DesignEngineeringProduct

Dismissible

DesignEngineeringProduct

States

  • DesignEngineeringProduct
    default
  • DesignEngineeringProduct
    size="sm"
  • DesignEngineeringProduct
    size="md"
  • DesignEngineeringProduct
    tone="neutral"
  • DesignEngineeringProduct
    tone="info"
  • DesignEngineeringProduct
    tone="success"
  • DesignEngineeringProduct
    tone="warning"
  • DesignEngineeringProduct
    tone="danger"
  • DesignEngineeringProduct
    tone="leap"
  • DesignEngineeringProduct
    tone="bookub"
  • DesignEngineeringProduct
    tone="payub"

Props

Props
PropTypeDefaultDescription
onRemove(() => void)—When provided, renders a dismiss button that calls this handler.
removeLabelstring—Accessible name of the dismiss button (5.2), e.g. "Remove Bug". Use it when several chips sit together.
size'sm' | 'md''md'Controls chip size.
tone'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'leap' | 'bookub' | 'payub' | 'founderub''neutral'

Design tokens

Chip reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Chip below it, and leave the roles other components share alone. See the three token tiers.

The neutral tone; the other tones keep their container colours.

Chip design tokens
TokenAliasesNotes
--chip-neutral-bg--color-surface-container-low—
--chip-neutral-fg--color-on-surface-variant—
--chip-neutral-border--color-outline-variant—
--chip-radius--shape-controlThe signature theme's --shape-pill comes first when it is set.
CSS
/* One area of your app */
.checkout {
  --chip-neutral-bg: var(--color-secondary);
}