Command Menu

Search documentation, components, and switch theme.

Atoms

Toggle

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

shadcn/ui
Docs

Installation#

npx shadcn@latest add @formance/toggle

Install the following dependencies:

npm install class-variance-authority radix-ui

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage#

import { Toggle } from '@/components/ui/toggle'
<Toggle aria-label="Toggle italic">
  <Italic className="h-4 w-4" />
</Toggle>

Examples#

Default#

Outline#

With Text#

Small#

Large#

Disabled#