Components
Switch
An on/off toggle — a settings switch, measured from the live app.
Available since@crisp-ui-kit/crisp@0.11.0
The toggle used throughout Settings — a 24×16 pill track that flips from a muted grey to brand blue with a 12px white thumb that slides across. Renders a role="switch" button (a native checkbox's semantics without its box), so label association and keyboard (Space / Enter) come for free.
Installation
npm install @crisp-ui-kit/crispLarge size
Props
Prop
Type
Notes
- Semantics. It's a
<button role="switch">witharia-checked— screen readers announce "switch, on/off", and Space/Enter toggle it natively. Give it anaria-labelor wrap it in a<label>. - Controlled vs uncontrolled. With
checkedset, the parent owns the value (the switch won't self-update); otherwise it tracks its own state fromdefaultChecked. - Measured. Track
24×16, thumb12px(2px inset, slides8px), on-colour#266df0; the background and thumb both animate.2s. - Large size.
size="lg"(crisp#1302) is Linear's settings switch: a30×20track with a16pxthumb. It is opt-in; the defaultmdstays Attio's24×16, so nothing changes unless you pass the prop. Keep one size within a settings list.
Used across the settings surface — see it in a settings screen soon.