Switch

Documentation and examples for the Switch component.

Preview

Properties

PropTypeDefaultDescription
labelstring-Text shown next to the switch.
defaultCheckedbooleanfalseThe initial state.

Usage

Follow these steps to add and use Switch.

1

Create next app (skip if you already have setup a next app)

terminal
npx create-next-app@latest --yes
2

Install

terminal
npx modui-uikit@latest add switch
3

Implement

typescript
import { Switch } from '@/components/ui/switch'

export default function Example() {
  return <Switch label="Enable Notifications" defaultChecked={true} />
}