LabelGroup

Use LabelGroup to add commonly used margins and other layout constraints to groups of Labels

React
readyNot reviewed for a11y

A LabelGroup is a component to handle the layout of a collection of labels or tokens.

React examples

Default

  • One
  • Two
  • Three
  • Four
  • Five
  • Six
  • Seven
  • Eight
  • Nine
  • Ten
  • Eleven
  • Twelve
  • Thirteen
  • Fourteen
  • Fifteen
  • Sixteen

Truncated

Trunacte after 5 labels

  • One
  • Two
  • Three
  • Four
  • Five
  • Six
  • Seven
  • Eight
  • Nine
  • Ten
  • Eleven
  • Twelve
  • Thirteen
  • Fourteen
  • Fifteen
  • Sixteen

Trunacte labels based on container size

  • One
  • Two
  • Three
  • Four
  • Five
  • Six
  • Seven
  • Eight
  • Nine
  • Ten
  • Eleven
  • Twelve
  • Thirteen
  • Fourteen
  • Fifteen
  • Sixteen

More code examples

See the LabelGroup Storybook stories

Props

LabelGroup

NameRequiredDescription
overflowStyle
'inline' | 'overlay'
How hidden tokens should be shown. `'inline'` shows the hidden tokens after the visible tokens. `'overlay'` shows all tokens in an overlay that appears on top of the visible tokens.
visibleChildCount
'auto' | number
How many tokens to show. `'auto'` truncates the tokens to fit in the parent container. Passing a number will truncate after that number tokens. If this is undefined, tokens will never be truncated.
as
React.ElementType
Customize the element type of the rendered container.