Components
Chip
Compact toggle button that switches one option on and off and keeps its own pressed state.
import { Chip } from "@openperf/deft";
<Chip.Root onPressedChange={setUnresolved} pressed={unresolved}>
Unresolved
</Chip.Root>;When to use
| Need | Component |
|---|---|
| Combinable options that apply as soon as they are pressed | Chip |
| Static label that cannot be pressed | Badge, Tag or Dot |
| Exactly one view out of several | Tabs |
| Setting inside a form or a settings list | Switch or Checkbox |
| One-off action | Button |
State
Each chip keeps its own state: pressing one does not release the others. Leave it uncontrolled with defaultPressed, or control it with pressed and onPressedChange. A pressed chip is drawn in the inverse colors.
| Property | Value |
|---|---|
| Height | 24px |
| Label | One line, never wraps. |
| Icon | Tabler icons are sized to 12px. |
| Disabled | Dimmed, with pointer events blocked. |
API
Prop
Type