Switch

Toggle switch for boolean states. Supports label and description text.

Preview

Usage

import { Switch } from '@ramtt/ui'

<Switch checked={enabled} onChange={setEnabled} label="Notifications" />
<Switch
  checked={darkMode}
  onChange={setDarkMode}
  label="Dark mode"
  description="Use dark theme across the app"
/>

Props

PropTypeDefaultDescription
checked*booleanSwitch state
onChange*(checked: boolean) => voidChange handler
labelstringLabel text
descriptionstringDescription below label
disabledbooleanfalseDisable the switch