v149 · css · flexbox

Chip Editor

Add and remove chips interactively. Toggle between flex-wrap: wrap and flex-wrap: balance to see how balance adapts the layout as the chip set grows and shrinks — even with chips of wildly different widths.

flex-wrap: wrap
/* The chip container only needs one CSS change */
.chip-group {
  display: flex;
  gap: 0.4rem;
  /* before: */ flex-wrap: wrap;
  /* after:  */ flex-wrap: balance;
}

/* Chips themselves need no changes.
   The browser picks a line count that
   minimises max-line-width variance. */

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗