BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/toggle

toggle

showcase-elevenlabs/toggle
FreeComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/toggle.json

Source

ui/toggle.tsxraw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/toggle.json
1"use client"
2
3import * as React from "react"
4import * as TogglePrimitive from "@radix-ui/react-toggle"
5import { cva, type VariantProps } from "class-variance-authority"
6
7import { cn } from "@/lib/utils"
8
9const toggleVariants = cva(
10 "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
11 {
12 variants: {
13 variant: {
14 default: "bg-transparent",
15 outline:
16 "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
17 },
18 size: {
19 default: "h-9 px-2 min-w-9",
20 sm: "h-8 px-1.5 min-w-8",
21 lg: "h-10 px-2.5 min-w-10",
22 },
23 },
24 defaultVariants: {
25 variant: "default",
26 size: "default",
27 },
28 }
29)
30
31const Toggle = React.forwardRef<
32 React.ElementRef<typeof TogglePrimitive.Root>,
33 React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
34 VariantProps<typeof toggleVariants>
35>(({ className, variant, size, ...props }, ref) => (
36 <TogglePrimitive.Root
37 ref={ref}
38 className={cn(toggleVariants({ variant, size, className }))}
39 {...props}
40 />
41))
42
43Toggle.displayName = TogglePrimitive.Root.displayName
44
45export { Toggle, toggleVariants }

What it pulls in

npm packages

  • @radix-ui/react-toggle

Files it writes

  • registry/new-york/ui/toggle.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

showcase.elevenlabs.io elevenlabs/showcase on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 357 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsFree1 dep
alertalertshadcn/uiComponentsFreeno deps
alert-dialogalert-dialogshadcn/uiComponentsFree1 dep
aspect-ratioaspect-ratioshadcn/uiComponentsFree1 dep
avataravatarshadcn/uiComponentsFree1 dep
badgebadgeshadcn/uiComponentsFree1 dep
breadcrumbbreadcrumbshadcn/uiComponentsFree1 dep
buttonbuttonshadcn/uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex