# Button Group

Buttons joined into one control, such as a split button or a toolbar segment.

Buttons joined into one control: a split button, a set of related actions, a toolbar segment. The children are real Buttons (or Toggles, or a Menu's trigger); the group only joins them: the inner corners go square, neighbours share one hairline, a focused button rises above its neighbours. Horizontal or vertical. JSON specs can list the buttons as items. Not a single choice: that is the segmented control.

Kind: component · Category: Actions · Status: beta · Targets: React, Vue, Svelte

## Add

```bash
npx fndn add button-group
```

It writes the folder `button-group/` into the project's ui folder (`index.ts`, `button-group.tsx`, `ButtonGroup.vue`, `ButtonGroup.svelte`, `button-group.recipe.ts`), and what it is built from: [Button](/components/button.md). First time: [Installation](/installation.md).

## Usage

```tsx
import { ButtonGroup } from "@/components/ui/button-group";
```

```vue
import { ButtonGroup } from "@/components/ui/button-group";
```

```svelte
import { ButtonGroup } from "$lib/components/ui/button-group";
```

## Parts

In the DOM the root carries `data-slot="button-group"` and each part `data-slot="button-group-<part>"`; in the recipe the root is the `base` slot and each part a slot named after it in camelCase.

| Part | Element | data-slot | Flags | Notes |
| --- | --- | --- | --- | --- |
| `root` | `div` | `button-group` |  | role=group with an aria-label; an inline flex row (a column when vertical) with no gap. Its direct children lose the radius of their inner corners (logical: start and end, mirrored right-to-left; top and bottom when vertical). Each child's ring overlaps the previous child's edge, so a join is one 1px hairline. A focused child (and the pressed one) sits above its neighbours. Vertical: children stretch to the widest and use radius.control (a pill cannot be split top to bottom). |
| `item` | `button` | `button-group-item` | optional, repeats | A Button made from the items prop, marked data-button-group="item"; it takes the group's variant, size and shape. |

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` |  |
| `label` | `string` |  | The group's accessible name (aria-label). |
| `items` | `array` |  | Buttons as data, rendered before the children: { value, label, disabled? }. A click calls onItemClick(value). |
| `variant` | `"outline" \| "primary" \| "secondary" \| "ghost"` | `"outline"` | The Button variant of the items (children set their own). |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` | The Button size of the items: xs 24px, sm 28px, md 32px, lg 36px. |
| `shape` | `"pill" \| "rounded"` |  | The Button shape of the items. Left out, the app's shape: a pill, or rounded in a rounded app ("shape": "rounded" in the project's fndn.json). Named: pill (the group's outer ends are round) or rounded. |

Other attributes and `class` go to the root; `class` is merged through the recipe.

## Events

| Event | Payload |
| --- | --- |
| `itemClick` | (value: string) after a click on an item |

## Slots

| Slot | Content |
| --- | --- |
| `default` | Buttons, Toggles or a Menu with its trigger, after the items. |

## Keyboard and accessibility

Role: group.

Keyboard:

- Tab reaches each button in turn (a group is not a single tab stop: it is several actions, not one choice)
- Enter / Space activate the focused button

Notes:

- Give the group a label that names what its buttons act on ("Text alignment", "Merge options").
- Icon-only buttons in it still need their own name (tooltip or aria-label).

## Motion

- press: the boxes stay still. A joined button never scales (the join would open) and the group is not scaled either; the pressed button's label and icon dip inside it (motion.press-scale-sm over duration.press), from the pointer only
- hover: the Buttons' own fills over duration.fast (pointer only)
- the group adds no motion

## Dependencies

- [Button](/components/button.md)

## Examples

### Merge, with more ways in a menu

React · `merge-pull-request.tsx`

```tsx
import { CaretDown } from "@phosphor-icons/react";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";
import { Menu } from "@/components/ui/menu";
import { Tooltip } from "@/components/ui/tooltip";

/* a split button: the common action, and a menu of the other ways to do it */
const ways = [
  { value: "squash", label: "Squash and merge" },
  { value: "rebase", label: "Rebase and merge" },
];

export default function MergePullRequest() {
  return (
    <ButtonGroup label="Merge #482">
      <Button variant="primary">Merge pull request</Button>
      <Menu placement="bottom-end" items={ways}>
        <Tooltip content="More ways to merge">
          <Button variant="primary" square aria-label="More ways to merge" icon={<CaretDown data-slot="icon" weight="bold" />} />
        </Tooltip>
      </Menu>
    </ButtonGroup>
  );
}
```

Vue · `merge-pull-request.vue`

```vue
<script setup lang="ts">
import { PhCaretDown } from "@phosphor-icons/vue";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";
import { Menu } from "@/components/ui/menu";
import { Tooltip } from "@/components/ui/tooltip";

/* a split button: the common action, and a menu of the other ways to do it */
const ways = [
  { value: "squash", label: "Squash and merge" },
  { value: "rebase", label: "Rebase and merge" },
];
</script>

<template>
  <ButtonGroup label="Merge #482">
    <Button variant="primary">Merge pull request</Button>
    <Menu placement="bottom-end" :items="ways">
      <template #trigger>
        <Tooltip content="More ways to merge">
          <Button variant="primary" square aria-label="More ways to merge">
            <template #icon><PhCaretDown data-slot="icon" weight="bold" /></template>
          </Button>
        </Tooltip>
      </template>
    </Menu>
  </ButtonGroup>
</template>
```

Svelte · `merge-pull-request.svelte`

```svelte
<script lang="ts">
  import CaretDown from "phosphor-svelte/lib/CaretDownIcon";
  import { Button } from "$lib/components/ui/button";
  import { ButtonGroup } from "$lib/components/ui/button-group";
  import { Menu } from "$lib/components/ui/menu";
  import { Tooltip } from "$lib/components/ui/tooltip";

  /* a split button: the common action, and a menu of the other ways to do it */
  const ways = [
    { value: "squash", label: "Squash and merge" },
    { value: "rebase", label: "Rebase and merge" },
  ];
</script>

<ButtonGroup label="Merge #482">
  <Button variant="primary">Merge pull request</Button>
  <Menu placement="bottom-end" items={ways}>
    {#snippet trigger(menuProps)}
      <Tooltip content="More ways to merge" {...menuProps()}>
        {#snippet trigger(tipProps)}
          <Button {...tipProps()} variant="primary" square aria-label="More ways to merge">
            {#snippet icon()}<CaretDown data-slot="icon" weight="bold" />{/snippet}
          </Button>
        {/snippet}
      </Tooltip>
    {/snippet}
  </Menu>
</ButtonGroup>
```

### Previous and next page

React · `members-pager.tsx`

```tsx
import { useState } from "react";
import { CaretLeft, CaretRight } from "@phosphor-icons/react";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";

/* previous / next as one joined pair; the range beside it says where you are */
const TOTAL = 1284;
const PER_PAGE = 20;

export default function MembersPager() {
  const [page, setPage] = useState(1);
  const last = Math.ceil(TOTAL / PER_PAGE) - 1;
  const from = page * PER_PAGE + 1;
  const to = Math.min(TOTAL, from + PER_PAGE - 1);
  return (
    <div className="flex items-center gap-3">
      <span className="text-sm text-ink-2 tabular-nums">{from}–{to} of 1,284 members</span>
      <ButtonGroup label="Pages">
        <Button size="sm" square aria-label="Previous page" disabled={page === 0} onClick={() => setPage(page - 1)} icon={<CaretLeft data-slot="icon" weight="bold" />} />
        <Button size="sm" square aria-label="Next page" disabled={page === last} onClick={() => setPage(page + 1)} icon={<CaretRight data-slot="icon" weight="bold" />} />
      </ButtonGroup>
    </div>
  );
}
```

Vue · `members-pager.vue`

```vue
<script setup lang="ts">
import { computed, ref } from "vue";
import { PhCaretLeft, PhCaretRight } from "@phosphor-icons/vue";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";

/* previous / next as one joined pair; the range beside it says where you are */
const TOTAL = 1284;
const PER_PAGE = 20;

const page = ref(1);
const last = Math.ceil(TOTAL / PER_PAGE) - 1;
const from = computed(() => page.value * PER_PAGE + 1);
const to = computed(() => Math.min(TOTAL, from.value + PER_PAGE - 1));
</script>

<template>
  <div class="flex items-center gap-3">
    <span class="text-sm text-ink-2 tabular-nums">{{ from }}–{{ to }} of 1,284 members</span>
    <ButtonGroup label="Pages">
      <Button size="sm" square aria-label="Previous page" :disabled="page === 0" @click="page--">
        <template #icon><PhCaretLeft data-slot="icon" weight="bold" /></template>
      </Button>
      <Button size="sm" square aria-label="Next page" :disabled="page === last" @click="page++">
        <template #icon><PhCaretRight data-slot="icon" weight="bold" /></template>
      </Button>
    </ButtonGroup>
  </div>
</template>
```

Svelte · `members-pager.svelte`

```svelte
<script lang="ts">
  import CaretLeft from "phosphor-svelte/lib/CaretLeftIcon";
  import CaretRight from "phosphor-svelte/lib/CaretRightIcon";
  import { Button } from "$lib/components/ui/button";
  import { ButtonGroup } from "$lib/components/ui/button-group";

  /* previous / next as one joined pair; the range beside it says where you are */
  const TOTAL = 1284;
  const PER_PAGE = 20;

  let page = $state(1);
  const last = Math.ceil(TOTAL / PER_PAGE) - 1;
  const from = $derived(page * PER_PAGE + 1);
  const to = $derived(Math.min(TOTAL, from + PER_PAGE - 1));
</script>

<div class="flex items-center gap-3">
  <span class="text-sm text-ink-2 tabular-nums">{from}–{to} of 1,284 members</span>
  <ButtonGroup label="Pages">
    <Button size="sm" square aria-label="Previous page" disabled={page === 0} onclick={() => page--}>
      {#snippet icon()}<CaretLeft data-slot="icon" weight="bold" />{/snippet}
    </Button>
    <Button size="sm" square aria-label="Next page" disabled={page === last} onclick={() => page++}>
      {#snippet icon()}<CaretRight data-slot="icon" weight="bold" />{/snippet}
    </Button>
  </ButtonGroup>
</div>
```

### Undo and redo, icon-only

React · `undo-redo.tsx`

```tsx
import { ArrowClockwise, ArrowCounterClockwise } from "@phosphor-icons/react";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";
import { Tooltip } from "@/components/ui/tooltip";

/* icon-only and joined: each button named by aria-label and its tooltip */
export default function UndoRedo() {
  return (
    <ButtonGroup label="History">
      <Tooltip content="Undo">
        <Button size="sm" shape="rounded" square aria-label="Undo" icon={<ArrowCounterClockwise data-slot="icon" weight="bold" />} />
      </Tooltip>
      <Tooltip content="Redo">
        <Button size="sm" shape="rounded" square aria-label="Redo" disabled icon={<ArrowClockwise data-slot="icon" weight="bold" />} />
      </Tooltip>
    </ButtonGroup>
  );
}
```

Vue · `undo-redo.vue`

```vue
<script setup lang="ts">
import { PhArrowClockwise, PhArrowCounterClockwise } from "@phosphor-icons/vue";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";
import { Tooltip } from "@/components/ui/tooltip";
</script>

<!-- icon-only and joined: each button named by aria-label and its tooltip -->
<template>
  <ButtonGroup label="History">
    <Tooltip content="Undo">
      <Button size="sm" shape="rounded" square aria-label="Undo">
        <template #icon><PhArrowCounterClockwise data-slot="icon" weight="bold" /></template>
      </Button>
    </Tooltip>
    <Tooltip content="Redo">
      <Button size="sm" shape="rounded" square aria-label="Redo" disabled>
        <template #icon><PhArrowClockwise data-slot="icon" weight="bold" /></template>
      </Button>
    </Tooltip>
  </ButtonGroup>
</template>
```

Svelte · `undo-redo.svelte`

```svelte
<script lang="ts">
  import ArrowClockwise from "phosphor-svelte/lib/ArrowClockwiseIcon";
  import ArrowCounterClockwise from "phosphor-svelte/lib/ArrowCounterClockwiseIcon";
  import { Button } from "$lib/components/ui/button";
  import { ButtonGroup } from "$lib/components/ui/button-group";
  import { Tooltip } from "$lib/components/ui/tooltip";
</script>

<!-- icon-only and joined: each button named by aria-label and its tooltip -->
<ButtonGroup label="History">
  <Tooltip content="Undo">
    {#snippet trigger(props)}
      <Button {...props()} size="sm" shape="rounded" square aria-label="Undo">
        {#snippet icon()}<ArrowCounterClockwise data-slot="icon" weight="bold" />{/snippet}
      </Button>
    {/snippet}
  </Tooltip>
  <Tooltip content="Redo">
    {#snippet trigger(props)}
      <Button {...props()} size="sm" shape="rounded" square aria-label="Redo" disabled>
        {#snippet icon()}<ArrowClockwise data-slot="icon" weight="bold" />{/snippet}
      </Button>
    {/snippet}
  </Tooltip>
</ButtonGroup>
```

### Export formats, from items

React · `export-usage.tsx`

```tsx
import { useState } from "react";
import { ButtonGroup } from "@/components/ui/button-group";

/* buttons from data: one handler gets the value of the button pressed */
const formats = [
  { value: "csv", label: "CSV" },
  { value: "json", label: "JSON" },
  { value: "pdf", label: "PDF" },
];

export default function ExportUsage() {
  const [file, setFile] = useState("");
  return (
    <div className="flex flex-col items-start gap-2">
      <ButtonGroup label="Export usage as" size="sm" items={formats} onItemClick={(format) => setFile(`usage-nov-2026.${format}`)} />
      <p className="text-sm text-ink-2" role="status">{file ? `Preparing ${file}…` : "Usage for Nov 1 – Nov 14, 2026"}</p>
    </div>
  );
}
```

Vue · `export-usage.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import { ButtonGroup } from "@/components/ui/button-group";

/* buttons from data: one handler gets the value of the button pressed */
const formats = [
  { value: "csv", label: "CSV" },
  { value: "json", label: "JSON" },
  { value: "pdf", label: "PDF" },
];

const file = ref("");
</script>

<template>
  <div class="flex flex-col items-start gap-2">
    <ButtonGroup label="Export usage as" size="sm" :items="formats" @item-click="(format) => (file = `usage-nov-2026.${format}`)" />
    <p class="text-sm text-ink-2" role="status">{{ file ? `Preparing ${file}…` : "Usage for Nov 1 – Nov 14, 2026" }}</p>
  </div>
</template>
```

Svelte · `export-usage.svelte`

```svelte
<script lang="ts">
  import { ButtonGroup } from "$lib/components/ui/button-group";

  /* buttons from data: one handler gets the value of the button pressed */
  const formats = [
    { value: "csv", label: "CSV" },
    { value: "json", label: "JSON" },
    { value: "pdf", label: "PDF" },
  ];

  let file = $state("");
</script>

<div class="flex flex-col items-start gap-2">
  <ButtonGroup label="Export usage as" size="sm" items={formats} onitemclick={(format) => (file = `usage-nov-2026.${format}`)} />
  <p class="text-sm text-ink-2" role="status">{file ? `Preparing ${file}…` : "Usage for Nov 1 – Nov 14, 2026"}</p>
</div>
```

### Deploy actions in a side panel (vertical)

React · `deploy-actions.tsx`

```tsx
import { ArrowClockwise, ArrowSquareOut, DownloadSimple } from "@phosphor-icons/react";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";

/* vertical: a stack of related actions in a narrow side panel */
export default function DeployActions() {
  return (
    <ButtonGroup label="Deploy dpl_7f3a9c" orientation="vertical" className="w-52">
      <Button size="sm" icon={<ArrowSquareOut data-slot="icon" weight="bold" />}>Open preview</Button>
      <Button size="sm" icon={<DownloadSimple data-slot="icon" weight="bold" />}>Download build log</Button>
      <Button size="sm" icon={<ArrowClockwise data-slot="icon" weight="bold" />}>Redeploy</Button>
    </ButtonGroup>
  );
}
```

Vue · `deploy-actions.vue`

```vue
<script setup lang="ts">
import { PhArrowClockwise, PhArrowSquareOut, PhDownloadSimple } from "@phosphor-icons/vue";
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";
</script>

<!-- vertical: a stack of related actions in a narrow side panel -->
<template>
  <ButtonGroup label="Deploy dpl_7f3a9c" orientation="vertical" class="w-52">
    <Button size="sm">
      <template #icon><PhArrowSquareOut data-slot="icon" weight="bold" /></template>
      Open preview
    </Button>
    <Button size="sm">
      <template #icon><PhDownloadSimple data-slot="icon" weight="bold" /></template>
      Download build log
    </Button>
    <Button size="sm">
      <template #icon><PhArrowClockwise data-slot="icon" weight="bold" /></template>
      Redeploy
    </Button>
  </ButtonGroup>
</template>
```

Svelte · `deploy-actions.svelte`

```svelte
<script lang="ts">
  import ArrowClockwise from "phosphor-svelte/lib/ArrowClockwiseIcon";
  import ArrowSquareOut from "phosphor-svelte/lib/ArrowSquareOutIcon";
  import DownloadSimple from "phosphor-svelte/lib/DownloadSimpleIcon";
  import { Button } from "$lib/components/ui/button";
  import { ButtonGroup } from "$lib/components/ui/button-group";
</script>

<!-- vertical: a stack of related actions in a narrow side panel -->
<ButtonGroup label="Deploy dpl_7f3a9c" orientation="vertical" class="w-52">
  <Button size="sm">
    {#snippet icon()}<ArrowSquareOut data-slot="icon" weight="bold" />{/snippet}
    Open preview
  </Button>
  <Button size="sm">
    {#snippet icon()}<DownloadSimple data-slot="icon" weight="bold" />{/snippet}
    Download build log
  </Button>
  <Button size="sm">
    {#snippet icon()}<ArrowClockwise data-slot="icon" weight="bold" />{/snippet}
    Redeploy
  </Button>
</ButtonGroup>
```

## Recipe

`button-group.recipe.ts`:

```ts
import { tv, type VariantProps } from "../lib/tv";

/* button-group — real Buttons joined into one control (a split button, related actions). The
 * group only joins its direct children; their look, sizes, hover and press are the Button's own.
 *
 *   corners   the inner corners lose their radius (logical start / end, so the join mirrors
 *             right-to-left; top / bottom when vertical)
 *   hairline  a Button draws its edge as a 1px ring outside its box (shadow.btn), translucent in
 *             the dark theme. Two rings on the same pixels, or a ring over a neighbour's fill,
 *             show as a thicker, brighter line with ticks at its ends. So the children sit 1px apart and every child
 *             but the first is clipped on its joined side: the line at a join is the previous
 *             child's ring alone, on the page like the outline, and meets the outline without
 *             overlapping it. A filled look (primary, accent …) has no ring: left alone, the 1px
 *             between two of them would show the page, a black line in the dark theme. Every child but the last therefore paints
 *             that pixel itself, in the colour its look names (`--_join`, set in button.recipe.ts: its
 *             fill, a little towards its text). Ghost buttons name none and keep a clear gap. A
 *             focused child is not clipped, so its focus ring is whole
 *   stacking  a focused child rises above its neighbours so its whole ring shows
 *   press     a joined button never scales: scaling alone it pulls away from its neighbour and
 *             shows a cut at the join, and scaling
 *             the whole group squashes buttons that were not pressed. The box stays still and the pressed button's
 *             label and icon dip inside it (the small press scale), from the pointer only
 *   direction the children take the group's direction (Zag may stamp dir="ltr" on a trigger)
 *   menu      a Menu child is a wrapper (data-slot=menu) around its trigger: the same corners
 *             reach the trigger inside it, so a split button is a Button and a Menu
 *   narrow    in a row narrower than its buttons they wrap onto the next line, each shown whole;
 *             only a button wider than the row by itself is cut at the end with a title (the
 *             Button's own truncation). Nothing overflows
 *   vertical  children stretch to the widest; a pill cannot be split top to bottom, so they take
 *             radius.control
 * Items made from the items prop are Buttons marked data-button-group="item"; the item slot is
 * passed to them as className, after their own classes. */

export const buttonGroup = tv({
  slots: {
    base: [
      "inline-flex max-w-full isolate",
      "[&>*]:relative [&>*:focus-within]:z-2 [&>*:focus-visible]:z-2",
      /* the joins are logical (start / end), read from each child's own direction. Zag stamps
       * dir="ltr" on a Menu or Tooltip trigger when no LocaleProvider tells it otherwise, which
       * would round a split button's caret on the wrong end in right-to-left: the children take
       * the group's direction instead */
      "[&>*]:[direction:inherit] [&>[data-slot=menu]>*]:[direction:inherit]",
      /* a press never moves a joined button's box (the join would open); its label and icon dip
       * inside it instead, from the pointer only. Visible on every look and in both themes, which
       * a dim of the fill was not (in dark it reads as two levels of grey) */
      "[&>[data-slot=button]:active]:[transform:none]! [&>[data-slot=menu]>[data-slot=button]:active]:[transform:none]!",
      "[&>[data-slot=button]>*]:motion-transform-press [&>[data-slot=menu]>[data-slot=button]>*]:motion-transform-press",
      "[:root:not([data-fndn-input=keyboard])_&>[data-slot=button]:active>*]:scale-press-sm [:root:not([data-fndn-input=keyboard])_&>[data-slot=menu]>[data-slot=button]:active>*]:scale-press-sm",
    ],
    item: "",
  },
  variants: {
    orientation: {
      horizontal: {
        base: [
          /* too many buttons for the row: they wrap onto the next line, whole (a number or a short
           * name is never cut); a single button wider than the row is cut by the Button's own rule */
          "flex-row flex-wrap items-stretch [&>*]:min-w-0 [&>*]:shrink [&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",
          "[&>*:not(:first-child)]:ms-px",
          "[&>[data-slot=button]:not(:last-child)]:after:absolute [&>[data-slot=button]:not(:last-child)]:after:inset-y-0 [&>[data-slot=button]:not(:last-child)]:after:-end-px [&>[data-slot=button]:not(:last-child)]:after:w-px [&>[data-slot=button]:not(:last-child)]:after:bg-(--_join) [&>[data-slot=button]:not(:last-child)]:after:content-[''] [&>[data-slot=button]:not(:last-child)]:after:pointer-events-none",
          "[&>[data-slot=menu]:not(:last-child)>[data-slot=button]]:after:absolute [&>[data-slot=menu]:not(:last-child)>[data-slot=button]]:after:inset-y-0 [&>[data-slot=menu]:not(:last-child)>[data-slot=button]]:after:-end-px [&>[data-slot=menu]:not(:last-child)>[data-slot=button]]:after:w-px [&>[data-slot=menu]:not(:last-child)>[data-slot=button]]:after:bg-(--_join) [&>[data-slot=menu]:not(:last-child)>[data-slot=button]]:after:content-['']",
          "ltr:[&>*:not(:first-child)]:[clip-path:inset(-12px_-12px_-12px_0)] rtl:[&>*:not(:first-child)]:[clip-path:inset(-12px_0_-12px_-12px)]",
          "[&>*:not(:first-child):focus-visible]:[clip-path:none] [&>*:not(:first-child):focus-within]:[clip-path:none]",
          "[&>[data-slot=menu]:not(:first-child)>*]:rounded-s-none [&>[data-slot=menu]:not(:last-child)>*]:rounded-e-none",
        ],
      },
      vertical: {
        base: [
          "flex-col items-stretch [&>*]:rounded-control",
          "[&>*:not(:first-child)]:mt-px [&>*:not(:first-child)]:[clip-path:inset(0_-12px_-12px_-12px)]",
          "[&>[data-slot=button]:not(:last-child)]:after:absolute [&>[data-slot=button]:not(:last-child)]:after:inset-x-0 [&>[data-slot=button]:not(:last-child)]:after:-bottom-px [&>[data-slot=button]:not(:last-child)]:after:h-px [&>[data-slot=button]:not(:last-child)]:after:bg-(--_join) [&>[data-slot=button]:not(:last-child)]:after:content-[''] [&>[data-slot=button]:not(:last-child)]:after:pointer-events-none",
          "[&>*:not(:first-child):focus-visible]:[clip-path:none] [&>*:not(:first-child):focus-within]:[clip-path:none]",
          "[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none",
          "[&>[data-slot=menu]>*]:w-full [&>[data-slot=menu]>*]:rounded-control",
          "[&>[data-slot=menu]:not(:first-child)>*]:rounded-t-none [&>[data-slot=menu]:not(:last-child)>*]:rounded-b-none",
        ],
      },
    },
  },
  defaultVariants: { orientation: "horizontal" },
});

export type ButtonGroupRecipeProps = VariantProps<typeof buttonGroup>;
```
