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/button-group

button-group

agentmesh/button-group
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/ombhanushaliii/agentmesh/main/example/ui/apps/v4/public/r/styles/base-vega/button-group.json

Source

registry/base-vega/ui/button-group.tsxraw.githubusercontent.com/ombhanushaliii/agentmesh/main/example/ui/apps/v4/public/r/styles/base-vega/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/base-vega/lib/utils"
6import { Separator } from "@/registry/base-vega/ui/separator"
7
8const buttonGroupVariants = cva(
9 "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-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
10 {
11 variants: {
12 orientation: {
13 horizontal:
14 "*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
15 vertical:
16 "flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0",
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-md border bg-muted px-2.5 text-sm font-medium shadow-xs [&_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

Other registry items

  • separator

Files it writes

  • registry/base-vega/ui/button-group.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 ombhanushaliii/agentmesh on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 201 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsFreeno deps
alertalertshadcn/uiComponentsFreeno deps
alert-dialogalert-dialogshadcn/uiComponentsFreeno deps
aspect-ratioaspect-ratioshadcn/uiComponentsFreeno deps
avataravatarshadcn/uiComponentsFreeno deps
badgebadgeshadcn/uiComponentsFreeno deps
breadcrumbbreadcrumbshadcn/uiComponentsFreeno deps
buttonbuttonshadcn/uiComponentsFreeno 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