Data display

Chip

A removable tag, or a filter when it wraps a checkbox.

Examples

Removable

Design CSS

Filters

Anatomy

span.chipRemovable tag: the label text, then an optional remove button.
> buttonOptional remove control, sized to the text. With data-dismiss=".chip" aequitas.js removes the chip.
label.chipFilter chip: a <label> wrapping its checkbox.
> input[type=checkbox]Stretched invisibly over the chip. Checked, the chip tints in its tone and draws an edge along the bottom.

API

AttributeValuesDescription
data-toneaccentsuccesswarningdangerinfoOn a filter chip, colours the checked tint and edge. Default accent.
data-dismisson button<selector>On the remove button: aequitas.js removes the closest match. Without a value it removes the closest .alert, .toast or .chip.

Behaviour

Clicking a [data-dismiss] button removes the closest chip (or whatever selector it names) and moves focus to the next focusable element, the previous one when nothing follows. Without aequitas.js the button renders but does nothing; filter chips are plain checkboxes and need no script.

From aequitas.js. It initialises itself and enhances markup added later on its own, so it works the same in an SPA.

Accessibility

  • The remove button shows only ×; give it an aria-label that names the chip ("Remove Design").
  • When focus was on the remove button, aequitas.js moves it to the next focusable element (the next chip's button, or the input in a tag input), so it never drops to the page.
  • Filter chips are real checkboxes inside a <label>, so they announce their checked state. The state is shown by tint and edge, not colour alone.
KeyEffect
SpaceToggles a filter chip's checkbox.
Enter / SpaceActivates the remove button.
Jump to
ProportionFoundations
MaterialFoundations
PresetsFoundations
ShellLayouts · Application
Container and stacksLayouts · Pages
SplitLayouts · Pages
Grid, bento, masonryLayouts · Pages
Switcher and rowLayouts · Pages
↑↓Move↵OpenescClose