Docs
Toggle

Toggle

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

Loading...
Loading...

Installation

npx shadcn-ng@latest add toggle
npm
yarn
pnpm
bun

Install the following dependencies:

npm install @radix-ng/primitives
npm
yarn
pnpm
bun

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

import { UbToggleDirective } from "@/components/ui/toggle"
<button ubToggle>Toggle</button>