Chip API
- Component status:
-
stable
Import
Section titled “Import”import { Chip } from "@stratakit/structures";// ORimport * as Chip from "@stratakit/structures/Chip";Chip (default)
Section titled “Chip (default)”Chip is a UI component used to represent an item, attribute, or action in a compact visual style.
It supports two visual variants: solid for primary emphasis and outline for less prominent states.
Example:
<Chip label="Value" /><Chip label="Value" variant="outline" />ReactNode (required) The label displayed inside the chip.
onDismiss
Section titled “onDismiss”(() => void) | undefined (optional) undefined Callback invoked when the dismiss (”❌”) button is clicked.
If undefined, the dismiss button will not be rendered.
variant
Section titled “variant”"outline" | "solid" | undefined (optional) "solid" The variant style of the Chip. Use “solid” for primary states and “outline” for less prominent states.
Additional props
Section titled “Additional props”Chip.Root
Section titled “Chip.Root”Root component of the compositional Chip component.
Example:
<Chip.Root> <Chip.Label>Label</Chip.Label> <Chip.DismissButton onClick={onClick} /></Chip.Root>variant
Section titled “variant”"outline" | "solid" | undefined (optional) "solid" The variant style of the Chip. Use “solid” for primary states and “outline” for less prominent states.
Additional props
Section titled “Additional props”Chip.Label
Section titled “Chip.Label”Label component that should be used with the compositional Chip component.
Additional props
Section titled “Additional props”Chip.DismissButton
Section titled “Chip.DismissButton”Dismiss button component that should be used with the compositional Chip component.
string | undefined (optional) "Dismiss" Label for the dismiss button.
The final accessible name of the dismiss button is a combination of this label and the text content of Chip.Label.