Toggle

PreviousNext

A two-state button that can be turned on or off.

Docs
roiuiitem

Preview

Loading preview…
registry/brook/ui/toggle/toggle.tsx
"use client";

import { Toggle } from "@base-ui/react/toggle";
import { cn } from "@/lib/utils";
import styles from "./toggle.module.css";

function ToggleRoot({ className, ...props }: Toggle.Props) {
  return <Toggle className={cn(styles.root, className)} {...props} />;
}

export { ToggleRoot as Toggle };

Installation

npx shadcn@latest add @roiui/toggle

Usage

import { Toggle } from "@/components/toggle"
<Toggle />