Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chip

A compact label-like component for tags, filters, and selected tokens.

When To Use It

Use Chip to represent categorical metadata or user-selectable tags in a dense, readable format.

Constructing a Chip

use vizia::prelude::*;

Chip::new(cx, "Audio")
	.variant(ChipVariant::Filled);

Closable chip:

Chip::new(cx, "Filter: Active")
	.variant(ChipVariant::Outline)
	.on_close(|cx| cx.emit(AppEvent::RemoveFilter("active".into())));

Chip Modifiers

ModifierTypeDescriptionDefault
on_closeFn(&mut EventContext)Shows close button and triggers callback when pressed.hidden
variantimpl Res<impl Into<ChipVariant>>Visual style (Filled or Outline).Filled

Components and Styling

SelectorDescription
chipRoot chip element.
chip.outlineOutline variant class.
chip.closeApplied when close button is present.
chip .close-iconClose button/icon element.

Accessibility

  • Ensure closable chips expose clear meaning (for example via nearby text context).
  • For icon-only close affordances, provide enough context so assistive tech users understand what will be removed.