Viana Kitv0.1.4

Components

Switch

A control that allows the user to toggle between checked and not checked.

example.tsx

Import

tsx
import { AppSwitch } from "@/components/primitives/AppSwitch"

API Reference

AppSwitch extends all native <button> HTML attributes.

PropTypeDefaultDescription
checkedbooleanThe controlled checked state of the switch.
onCheckedChange(checked: boolean) => voidCallback fired when the checked state changes.
disabledbooleanWhether the switch is disabled.
classNamestringAdditional Tailwind classes merged via cn(). Prefer the wrapper pattern for reusable overrides.

Source

src/components/primitives/AppSwitch.tsx
"use client"

import { Switch } from "../ui/switch"

type AppSwitchProps = React.ComponentPropsWithoutRef<typeof Switch>

function AppSwitch(props: AppSwitchProps) {
  return <Switch {...props} />
}

export { AppSwitch }