Skip to content

    Browse components

    Ring Switch

    A notification switch whose bell swings and rings when enabled, and gets a drawn slash when muted.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/ring-switch

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/ring-switch.json

    Usage

    import { RingSwitch } from "@/components/ui/ring-switch";
    
    const [on, setOn] = useState(true);
    
    <RingSwitch checked={on} onCheckedChange={setOn} label="Notifications" />

    Props

    PropTypeDefaultDescription
    labelstring"Notifications"Visible label and accessible name.
    colorstring"#f59e0b"Track and bell color when enabled.
    defaultCheckedbooleantrueInitial state when uncontrolled.
    disabledbooleanfalseDisable the switch.
    checkedReactNode—Controlled state. Pair with onCheckedChange.
    onCheckedChangeReactNode—Called with the new state after each toggle.
    classNamestring—Extra classes for the root element.