Skip to content

Switch

Toggles a single setting on or off, with optional icons in the thumb.

import { Switch } from '@windmorph/react';

Playground

Code

import { useState } from 'react';import { Switch } from '@windmorph/react'; export function Example() {  const [checked, setChecked] = useState(true);   return (    <Switch      checked={checked}      onCheckedChange={setChecked}    >      Dark theme    </Switch>  );}

Examples

Basic

Icons in the thumb

Settings row

Disabled

Density