Skip to main content

Chip

Chips are clickable, and used for filtering and selections.

Submit feedback
github
import { Chip } from '@uhg-abyss/mobile';
<Chip>Chip</Chip>;

useState

Pass the value from the useState hook to the isChecked prop to set the checked state of the chip.

Group

Group has three variants: wrap, scroll and fit. The wrap variant is the default.

Wrap

Chips can be wrapped in a Group. When using this to group multiple chips together, a chip that is too long to stack horizontally wraps to the next line. This variant allows any number of chips to be selected when each chip has an isChecked and onChange.

Alternatively, passing the state into the Group (and not individual chips) will allow only one chip to be selected at a time.

Scroll

This variant has a filter button for selection and the chips scroll horizontally. Only one chip can be selected in this group. The heading prop is used to display a heading on the bottom sheet.

Fit

This variant does not scroll or have a filter button. The chips will fit the width of the parent container.

Like the wrap variant, multiple chips can be selected when each chip has an isChecked and onChange, and only one chip can be selected when the state is passed into the Group (as shown).

Icons

Use the icon prop to pass in a specific Icon component. Icons should be 20px and given an accurate title to meet accessibility standards. Find further guidance on icons symbols in the Icons Symbols Tab.

Dismissible Chips

Use the isClosable prop with the onClose function to allow a chip to be dismissed. The checked and pressed states are not enabled with a dismissible chip.

Disabled

Use the isDisabled prop to disable a chip.

Tag

Use the isTag prop to create a non-clickable chip.

Width

Chips do not wrap if the text gets longer than the width of the parent container. Instead, the text will truncate.

Chip Props

Prop NameTypeDefaultDescription
childrennode-The text to be input into the Chip component
iconnode-Adds an icon to the Chip component
isCheckedbooleanfalseFlag to check the chip and enable selected border
isClosablebooleanfalseAdds a close icon to the Chip component. Use with the onClose function to dismiss the chip
isDisabledbooleanfalseDisables a chip, making it unusable and un-clickable
isTagbooleanfalseCreates a tag. A smaller, non-clickable version of chip
onChangefunction-Callback fired when the chip is pressed
onClosefunction-Callback fired when the close button is pressed
valuestring-Value of the chip

Chip Classes

Class NameDescription
abyss-chip-close-buttonClose icon container
abyss-chip-close-iconClose icon
abyss-chip-labelChip label element
abyss-chip-rootChip root element

Chip.Group Props

Prop NameTypeDefaultDescription
childrennode-The chips to be input into the Chip Group component
headingstring-The heading displayed on the bottom sheet in the scroll variant
onChangefunction-Callback fired when the chip is pressed
valuestring-The value of the selected chip
variantstring-The variant of the Chip Group. Options are wrap, scroll, and fit

Chip.Group Classes

Class NameDescription
abyss-chip-group-rootChip group root element
abyss-chip-group-tab-barChip group tab bar element
abyss-chip-group-tab-bar-bottom-sheetChip group tab bar bottom sheet element
abyss-chip-group-tab-bar-menu-buttonChip group tab bar menu button element
abyss-chip-group-tab-bar-menu-iconChip group tab bar menu icon element

Chip Translations

Translation KeyValue
Chip.removeremove
Chip.openMenuOpen tab menu

Chip Tokens

Token NameValue
chip.color.surface.container.default
#F3F3F3
chip.color.surface.container.selected
#EDF3FB
chip.color.text.label.default
#323334
chip.color.text.label.selected
#002677
chip.color.icon.close
#4B4D4F
chip.color.border.container.default
#929496
chip.color.border.container.selected
#0C55B8
chip.border-radius.all.container
500
chip.border-width.all.container.default
0
chip.border-width.all.container.selected
2
chip.sizing.all.icon.close
20
chip.spacing.padding.vertical.container
8
chip.spacing.padding.horizontal.container
16
chip.spacing.gap.horizontal.container
8

Chip.Group Props

V2V1Status
childrenchildrenUnchanged
headingtitleRenamed
onChangeonChangeUnchanged
valuevalueUnchanged
variantvariantUnchanged
Table of Contents