Inspector toggle switch

An on or off setting in one row

The whole bar is the switch, with the name on the left and a small track at the end. A native checkbox with role="switch" covers the bar, so a click anywhere toggles it, Space toggles it from the keyboard, and both checked and defaultChecked work. The on state is neutral, never the action colour.

Sizes

The size prop matches Button’s: default is 40px tall and compact is 32px.

Default
Compact

Off and on

Disabled

Off
On

When to use it

Use the inspector toggle switch for a setting that applies at once in a dense panel, usually inside an inspector section. For a standalone switch with its label beside it, in a form or a settings page with room to breathe, use Toggle switch instead.

tsx
// From the npm package
import { InspectorToggleSwitch } from 'rift-ds/components/InspectorToggleSwitch/InspectorToggleSwitch';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/inspector-toggle-switch.json