randomseeds logo
Random Design System

Toggle

A two-state button that can be toggled on or off. Built on Radix UI Toggle.

Variants

Sizes

With Text

Disabled

Usage

Use toggles for binary settings that take effect immediately, like formatting options or feature flags.

For on/off settings with a clear label, consider using a Switch instead.

Props

PropTypeDefaultDescription
variant"default" | "outline""default"Visual style of the toggle
size"default" | "sm" | "lg""default"Size of the toggle
pressedbooleanControlled pressed state
onPressedChange(pressed: boolean) => voidCallback when toggle state changes
disabledbooleanfalseDisables the toggle