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

accelya-ui-lib/toggle
FreeComponent

shadcn/ui publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/ramsaoji/Accelya-UI-Lib/main/public/r/styles/default/toggle.json

Source

ui/toggle.tsxraw.githubusercontent.com/ramsaoji/Accelya-UI-Lib/main/public/r/styles/default/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 rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 gap-2",
11 {
12 variants: {
13 variant: {
14 default: "bg-transparent",
15 outline:
16 "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
17 },
18 size: {
19 default: "h-10 px-3 min-w-10",
20 sm: "h-9 px-2.5 min-w-9",
21 lg: "h-11 px-5 min-w-11",
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/default/ui/toggle.tsx

Facts

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

Go to the source

Docs on shadcn/ui ramsaoji/Accelya-UI-Lib 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