BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/muffled-ui-registry/button-group

Button Group

muffled-ui-registry/button-group
FreeComponent

Grouped actions with shared borders on ink and paper. Horizontal and vertical layouts.

Live preview

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

Install it

npx shadcn@latest add https://ui.muffled.studio/r/button-group.json

Source

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

What it pulls in

npm packages

  • class-variance-authority
  • @base-ui/react

Other registry items

  • @muffled/surface
  • @muffled/separator

Files it writes

  • registry/ui/button-group.tsx

Facts

Registry
muffled-ui-registry
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

Docs on muffled-ui-registry ui.muffled.studio muffled-studio/muffled.ui on GitHub Raw registry item This item as JSON

More from muffled-ui-registry

All 55 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionmuffled-ui-registryComponentsFree2 deps
Alertalertmuffled-ui-registryComponentsFree1 dep
Alert Dialogalert-dialogmuffled-ui-registryComponentsFree1 dep
Avataravatarmuffled-ui-registryComponentsFree1 dep
Badgebadgemuffled-ui-registryComponentsFree2 deps
Breadcrumbbreadcrumbmuffled-ui-registryComponentsFree2 deps
Buttonbuttonmuffled-ui-registryComponentsFree2 deps
Calendarcalendarmuffled-ui-registryComponentsFree2 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