TidalUI

Toggle switch preview

Labeled switches for settings and preferences.

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/toggle-switch

Import components/ui/tidal.css, components/ui/toggle-switch.css. Wrap installed components in tidal-scope.

Preview

Toggle switch component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/toggle-switch.css";
import{TidalSwitch}from"./components/ui/toggle-switch";
export default()=><div className="tidal-scope"><TidalSwitch checked={false} label={"Demo"} onCheckedChange={() => {}}/></div>;

API and props

TidalSwitch.checked (required)
boolean

Required checked value accepted by this exported component.

TidalSwitch.label (required)
string

Required label value accepted by this exported component.

TidalSwitch.onCheckedChange (required)
(checked: boolean) => void

Callback invoked when the checked change interaction is proposed.

TidalSwitch.description
string | undefined

Optional description value accepted by this exported component.

TidalSwitch.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas