In UI Chips
(also called pills) are small, interactive elements that represent a piece of information, such as a tag, category, or action.
For chips there's no real limit on how many "primary" you can have, but as a general rule of thumb you should try and limit them to a small number on any one page. This is because they are the most visually prominent and should be used for the most important information.
Examples of this include:
Try not to use primary chips for:
Primary is your default variant in a chip.
For everything else, there's secondary. This should be your "go to" in nitpick for anything that isn't important enough to be a primary chip.
Outlined chips serve a similar purpose to outlined buttons, they are used to denote a third option apart from a primary and secondary (tertiary, if you will), but most often in a stylistic choice.
You may want an outlined chip for:
Try not to:
Accent chips are often used as CTA's or a positively encouraged notice for the user.
This one's easy, don't delete your account by accident! Use this for destructive actions.
You can also add icons and other elements to your Chips to make them more interactive and visually appealing using
the startAdornment
and endAdornment
props.
Chips can be small, medium, or large. The default size is medium.
You may notice through usage that by default a chip applies a display: flex
style to itself. This is for layout
purposes as most chips are used in a flex container. If you want to use a chip in an inline context, you can set the
inline
prop to true
. This will swap it to an inline-flex
display style.
Should you need further customisation you can use the rootClassName
prop from the next example.
You can also pass a rootClassName
prop to the chip to apply custom styles to the root element.