Skip to content

Chip API

import { Chip } from "@stratakit/structures";
// OR
import * as Chip from "@stratakit/structures/Chip";
Base element: <div>

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" />
Type: ReactNode (required)

The label displayed inside the chip.

Type: (() => void) | undefined (optional)
Default: undefined

Callback invoked when the dismiss (”❌”) button is clicked.

If undefined, the dismiss button will not be rendered.

Type: "outline" | "solid" | undefined (optional)
Default: "solid"

The variant style of the Chip. Use “solid” for primary states and “outline” for less prominent states.

Base element: <div>

Root component of the compositional Chip component.

Example:

<Chip.Root>
<Chip.Label>Label</Chip.Label>
<Chip.DismissButton onClick={onClick} />
</Chip.Root>
Type: "outline" | "solid" | undefined (optional)
Default: "solid"

The variant style of the Chip. Use “solid” for primary states and “outline” for less prominent states.

Base element: <span>

Label component that should be used with the compositional Chip component.

Base element: <button>

Dismiss button component that should be used with the compositional Chip component.

Type: string | undefined (optional)
Default: "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.