Skip to content

Chip

Small label component with optional icon and delete action.

Also known as: tag, badge, label, pill

View in Storybook

When to use

  • Displaying small labels, tags, or status indicators. Use deletable for removable chips.
  • For inputting tags, use Tags component.

Import

tsx
import { Chip } from '@vacano/ui'

Usage

tsx
<Chip>Default Chip</Chip>

Variants

tsx
<Chip variant="gray">Gray</Chip>
<Chip variant="red">Red</Chip>
<Chip variant="blue">Blue</Chip>
<Chip variant="black">Black</Chip>

With icon

Render a leading icon inside the chip.

tsx
<Chip icon={<StarIcon />}>Starred</Chip>

Deletable

tsx
<Chip deletable onDelete={() => console.log('deleted')}>
  Removable
</Chip>

With icon and deletable

tsx
<Chip icon={<TagIcon />} deletable onDelete={() => console.log('deleted')}>
  Tag
</Chip>

Props

PropTypeDefaultDescription
childrenReactNoderequiredChip content
variant'gray' | 'red' | 'blue' | 'black''gray'Color variant
iconReactNode-Leading icon element
deletablebooleanfalseShow delete button
onDelete() => void-Delete callback
refRef<HTMLSpanElement>-Forwarded ref
classNamestring-CSS class name for the root element
classnamesChipClassNames-Custom class names for sub-elements

ClassNames

KeyDescription
iconThe leading icon wrapper
deleteDelete button
labelLabel text
  • Tags - Tag input with autocomplete

Released under the MIT License.