GitHub
Docs
Toggle

Toggle

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

Loading...
Loading...

Installation

pnpm dlx shadcn-ng@latest add toggle
npx shadcn-ng@latest add toggle
npx shadcn-ng@latest add toggle
bunx --bun shadcn-ng@latest add toggle

Install the following dependencies:

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

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>