BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/neobrutalism/switch

switch

neobrutalism/switch
FreeComponent

neobrutalism publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://retroui.dev/r/switch.json

Source

switch.tsxretroui.dev/r/switch.json
1"use client"
2
3import { Switch as SwitchPrimitive } from "@base-ui/react/switch"
4
5import { cn } from "@/lib/utils"
6
7function Switch({
8 className,
9 size = "default",
10 ...props
11}: SwitchPrimitive.Root.Props & {
12 size?: "sm" | "default"
13}) {
14 return (
15 <SwitchPrimitive.Root
16 data-slot="switch"
17 data-size={size}
18 className={cn(
19 "peer group/switch relative inline-flex shrink-0 cursor-pointer items-center border-2 border-foreground transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary aria-invalid:border-destructive data-[size=default]:h-6 data-[size=default]:w-11 data-[size=sm]:h-5 data-[size=sm]:w-9 data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50",
20 className
21 )}
22 {...props}
23 >
24 <SwitchPrimitive.Thumb
25 data-slot="switch-thumb"
26 className="pointer-events-none mx-0.5 block border-2 border-foreground bg-primary transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-5 group-data-[size=sm]/switch:data-checked:translate-x-4 data-checked:bg-background data-unchecked:translate-x-0"
27 />
28 </SwitchPrimitive.Root>
29 )
30}
31
32export { Switch }

What it pulls in

npm packages

  • @base-ui/react

Files it writes

  • switch.tsx

Facts

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

Go to the source

Docs on neobrutalism retroui.dev neobrutalism/neobrutalism on GitHub Raw registry item This item as JSON

More from neobrutalism

All 54 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionneobrutalismComponentsFree2 deps
alertalertneobrutalismComponentsFree2 deps
alert-dialogalert-dialogneobrutalismComponentsFree1 dep
aspect-ratioaspect-rationeobrutalismComponentsFree1 dep
avataravatarneobrutalismComponentsFree1 dep
badgebadgeneobrutalismComponentsFree2 deps
breadcrumbbreadcrumbneobrutalismComponentsFree2 deps
buttonbuttonneobrutalismComponentsFree2 deps
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