BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/gr8monk3ys/button-group

button-group

gr8monk3ys/button-group
FreeComponent

button-group (identity-styled).

Install it

npx shadcn@latest add https://ui.lscaturchio.xyz/r/button-group.json

Source

components/ui/button-group.tsxui.lscaturchio.xyz/r/button-group.json
1import { cva, type VariantProps } from "class-variance-authority"
2import { Slot } from "radix-ui"
3
4import { cn } from "@/lib/utils"
5import { Separator } from "@/components/ui/separator"
6
7const buttonGroupVariants = cva(
8 "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
9 {
10 variants: {
11 orientation: {
12 horizontal:
13 "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
14 vertical:
15 "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
16 },
17 },
18 defaultVariants: {
19 orientation: "horizontal",
20 },
21 }
22)
23
24function ButtonGroup({
25 className,
26 orientation,
27 ...props
28}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
29 return (
30 <div
31 role="group"
32 data-slot="button-group"
33 data-orientation={orientation}
34 className={cn(buttonGroupVariants({ orientation }), className)}
35 {...props}
36 />
37 )
38}
39
40function ButtonGroupText({
41 className,
42 asChild = false,
43 ...props
44}: React.ComponentProps<"div"> & {
45 asChild?: boolean
46}) {
47 const Comp = asChild ? Slot.Root : "div"
48
49 return (
50 <Comp
51 className={cn(
52 "flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
53 className
54 )}
55 {...props}
56 />
57 )
58}
59
60function ButtonGroupSeparator({
61 className,
62 orientation = "vertical",
63 ...props
64}: React.ComponentProps<typeof Separator>) {
65 return (
66 <Separator
67 data-slot="button-group-separator"
68 orientation={orientation}
69 className={cn(
70 "relative m-0! self-stretch bg-input data-[orientation=vertical]:h-auto",
71 className
72 )}
73 {...props}
74 />
75 )
76}
77
78export {
79 ButtonGroup,
80 ButtonGroupSeparator,
81 ButtonGroupText,
82 buttonGroupVariants,
83}

What it pulls in

npm packages

  • class-variance-authority
  • radix-ui

Other registry items

  • https://ui.lscaturchio.xyz/r/button.json
  • https://ui.lscaturchio.xyz/r/separator.json

Files it writes

  • components/ui/button-group.tsx

Facts

Registry
gr8monk3ys
Type
registry:ui
Access
Free
Files written
1
Licence
GPL-3.0
First indexed
2026-08-10
Last confirmed
today

Go to the source

ui.lscaturchio.xyz gr8monk3ys/ui on GitHub Raw registry item This item as JSON

More from gr8monk3ys

All 69 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordiongr8monk3ysComponentsFree2 deps
ActiveNavLinkactive-nav-linkgr8monk3ysComponentsFreeno deps · 2 files
alertalertgr8monk3ysComponentsFree1 dep
alert-dialogalert-dialoggr8monk3ysComponentsFree1 dep
aspect-ratioaspect-ratiogr8monk3ysComponentsFree1 dep
attachmentattachmentgr8monk3ysComponentsFree2 deps
Avataravatargr8monk3ysComponentsFree1 dep
Badgebadgegr8monk3ysComponentsFree1 dep
BlockDex

Built by

Kynth Studios

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 Studios

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 Studios

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