Switch
Documentation and examples for the Switch component.
Preview
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Text shown next to the switch. |
| defaultChecked | boolean | false | The 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 --yes2
Install
terminal
npx modui-uikit@latest add switch3
Implement
typescript
import { Switch } from '@/components/ui/switch'
export default function Example() {
return <Switch label="Enable Notifications" defaultChecked={true} />
}