jelly toggle

preview

usage

Provide a label for an accessible switch, then use controlled or default state depending on the form.

import { JellyToggle } from "@/components/jelly/jelly-toggle"

export function NotificationsToggle() {
  return <JellyToggle color="green" label="notifications" defaultChecked />
}

setup notes

Requires React, TypeScript, Tailwind CSS, and the included cn helper. No additional animation setup is required.

props

proptypedefaultpurpose
color"pink" | "blue" | "green" | "yellow" | "orange" | "red""green"Sets the active track color.
checkedboolean-Controls the switch state.
defaultCheckedbooleanfalseSets its initial uncontrolled state.
onChange(checked: boolean) => void-Receives state changes.
labelstring-Renders and labels the switch.