Chip
Pick one or multiple values with inline controls
Import
Source
Docs
Package
Usage
Color
Variant
Size
xs
sm
md
lg
xl
Radius
xs
sm
md
lg
xl
Controlled
States
Chip.Group
Chip.Group
component manages state of child Chip components,
set multiple
prop to allow multiple chips to be selected at a time:
Controlled Chip.Group
Customize styles
Accessibility
Chip
and Chip.Group
components are accessible by default – they are built with native radio/checkbox inputs,
all keyboard events work the same as with native controls.
Chip component props
Name | Type | Description |
---|---|---|
checked | boolean | Checked state for controlled component |
children * | ReactNode | Chip label |
color | MantineColor | Active color from theme, defaults to theme.primaryColor |
defaultChecked | boolean | Default value for uncontrolled component |
id | string | Static id to bind input with label |
onChange | (checked: boolean) => void | Calls when checked state changes |
radius | number | "xs" | "sm" | "md" | "lg" | "xl" | Chip radius from theme or number to set value in px |
size | "xs" | "sm" | "md" | "lg" | "xl" | Predefined chip size |
type | "checkbox" | "radio" | Chip input type |
variant | "outline" | "filled" | Controls chip appearance, defaults to filled with dark theme and to outline in light theme |
wrapperProps | Record<string, any> | Props spread to wrapper element |
Chip.Group component props
Name | Type | Description |
---|---|---|
align | AlignItems | Defines align-items css property |
children | ReactNode | <Chip /> components |
defaultValue | string | string[] | Uncontrolled component initial value |
grow | boolean | Defines flex-grow property for each element, true -> 1, false -> 0 |
multiple | boolean | Allow multiple values to be selected at a time |
noWrap | boolean | Defined flex-wrap property |
onChange | (value: T extends true ? string[] : string) => void | Called when value changes |
position | "left" | "right" | "center" | "apart" | Defines justify-content property |
spacing | number | "xs" | "sm" | "md" | "lg" | "xl" | Key of theme.spacing or number to set gap in px |
value | string | string[] | Controlled component value |
Chip component Styles API
Name | Static selector | Description |
---|---|---|
root | .mantine-Chip-root | Root element |
label | .mantine-Chip-label | Chip label, includes all other elements except input |
input | .mantine-Chip-input | Chip input, hidden by default |
iconWrapper | .mantine-Chip-iconWrapper | Check icon wrapper |
checkIcon | .mantine-Chip-checkIcon | Check icon, displayed when checkbox or radio is checked |