Chip

Compact colored label with optional icon and dismiss control.

Examples

Properties

PropertyAttributeDescriptionType nameTypeDefault
variantvariantVisual variant (`primary`, `secondary`, `success`, …)DuoChipVariantDuoBadgeVariant"primary"
labellabelText when the default slot is emptystringstring""
largelargeLarger padding and type scalebooleanbooleanfalse
outlineoutlineOutlined presentationbooleanbooleanfalse
dismissdismissShows a dismiss control at the endbooleanbooleanfalse
iconicon`@duo/icons` name for a leading icon when the `icon` slot is emptyIconName | undefinedIconName | undefined—

Slots

NameDescription
defaultLabel text; overrides `label` when provided.
iconLeading icon markup (overrides the `icon` attribute).
close-buttonCustom dismiss control (overrides the default close button when `dismiss` is set).

Usage

Chip shows a short label for applied filters, selected values, or lightweight metadata. Use variant, outline, and large for presentation; add an icon or dismiss control when the context calls for it.

Do

  • Use dismiss with a close listener when people can remove an applied filter or tag.
  • Keep labels short and readable; chips truncate with ellipsis when space is tight.
  • Use outline for lower emphasis or on tinted backgrounds; use filled variant values for stronger emphasis.
  • Provide a custom accessible name on close-button slot content when the default “Remove …” label is not enough.

Don’t

  • Don’t use chips for static status that cannot be removed—prefer Badge.
  • Don’t use a chip as the only way to complete a task; pair removable chips with clear surrounding copy.
  • Don’t rely on color alone; the label should still read clearly.

Variants

NamePurpose
primaryDefault brand emphasis.
secondaryLower-emphasis tinted surface.
successPositive or confirmed context.
dangerDestructive or error-adjacent context.
warningNeeds attention without blocking.
infoInformational context.
lightSubtle chip on busy backgrounds.
darkStrong contrast on light surfaces.

Set outline for a bordered presentation with a transparent fill.

Events

EventDetailDescription
close—Fired when the built-in dismiss control is activated (dismiss). Listen with @close / addEventListener("close", …).

Slots

SlotDescription
defaultLabel text; overrides label.
iconLeading icon markup; overrides the icon attribute.
close-buttonCustom dismiss control when dismiss is set.