Toggle
8 props
ReactNode"default" | "outline"default"default" | "sm" | "lg"defaultbooleanboolean(pressed: boolean) => voidbooleanstringNotes
Use the bookmark example to inspect the pressed-state motion, outline surface, and the filled icon change on activation.
Toggle the bookmark to inspect the pressed-state motion, ripple burst, and the filled icon treatment on the active state.
Install the component directly into your codebase, then branch into v0 if you want to iterate on variations.
Install
Build with v0
Send the registry bundle into v0 when you want to explore new colorways, copy, or layout directions quickly.
Notes
Start with a single controlled utility toggle like the snippet below, then expand into additional variants and sizes as needed.
"use client"; import { Bookmark } from "lucide-react";import { useState } from "react";import { Toggle } from "@/components/ui/toggle"; export function BookmarkToggle() { const [bookmarked, setBookmarked] = useState(false); return ( <Toggle aria-label="Toggle bookmark" className="gap-2 rounded-lg px-4 shadow-sm" onPressedChange={setBookmarked} pressed={bookmarked} variant="outline" > <Bookmark className="size-5" fill={bookmarked ? "currentColor" : "none"} /> Bookmark </Toggle> );}Each item below covers the documented props and the behavior that matters during implementation.
8 props
ReactNode"default" | "outline"default"default" | "sm" | "lg"defaultbooleanboolean(pressed: boolean) => voidbooleanstringNotes