A two-state button that can be either on or off. Built on Base UI Toggle primitives.
import { ToggleRoot } from "@/components/ui/static/toggle"<ToggleRoot pressed={pressed} onPressedChange={setPressed}>
<TextB className="h-4 w-4" />
</ToggleRoot>pressedbooleanThe controlled pressed state.
defaultPressedbooleanfalseInitial pressed state when uncontrolled.
onPressedChange(pressed: boolean) => voidCallback when pressed state changes.
disabledbooleanfalseWhether the toggle is disabled.
variant"default" | "outline""default"The visual style variant.
size"default" | "sm" | "lg""default"The size of the toggle.