View fulldotdev/ui on GitHub

Toggle

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

Installation

npx shadcn@latest add @fulldev/toggle

Usage

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

Outline

Use variant="outline" for an outline style.

With Text

Size

Use the size prop to change the size of the toggle.

Disabled

RTL

To enable RTL support in shadcn/ui, see the RTL configuration guide.

API Reference

Source: react/src/components/ui/toggle.tsx

See the Base UI Toggle documentation.