Switch

A control that can be toggled on or off.
Properties
checked
Example
Source Code
Installation
"use client";

import React from "react";
import { Switch } from "@/subframe/components/Switch";

function SwitchExample() {
  return <Switch checked={false} onCheckedChange={(checked: boolean) => {}} />;
}

export default SwitchExample;

Props

Switch
Thumb
Prop
Type
Default
Additional info
checked
boolean
Checked state of the switch
onCheckedChange
(checked: boolean) => void
Handler called when the checked state of the switch changes.

Examples

Controlled

Use checked and onCheckedChange props to control the switch state.