Skip to content
aq-ui
Back to ComponentsComponent

Toggle

Open-code aq-ui accessible component family for Toggle.

Preview

This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.

Loading interactive preview…

Installation

pnpm dlx aq-ui@alpha add toggle

API reference

Client module

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

"use client"

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

<Toggle />

Toggle

constSource L32

Open-code aq-ui accessible component family for Toggle.

const Toggle = React.forwardRef<React.ComponentRef<typeof TogglePrimitive>, TogglePrimitive.Props & VariantProps<typeof toggleVariants>>(…)
Props type
TogglePrimitive.Props & VariantProps<typeof toggleVariants>
<Toggle />

toggleVariants

constSource L10

Public const export from Toggle.

const toggleVariants = cva(…)

Registry dependencies

utils

Package dependencies

@base-ui/react@^1.7.0, class-variance-authority@^0.7.1

Files

  • components/ui/toggle.tsx

Source