For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Button Group

Groups related buttons into a single visual unit for React Native apps running on Android and iOS via Expo.

A View wrapper that lays out children in a row (horizontal, default) or a column (vertical). Each direct child is cloned to strip the shared border and radius on the inner edges, so adjacent buttons read as a single unit. Outer corners keep their full radius.

Installation

Usage

button-group.tsx
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";
button-group.tsx
<ButtonGroup>
  <Button variant="outline">Archive</Button>
  <Button variant="outline">Report</Button>
</ButtonGroup>

Orientation

Pass orientation="vertical". Children stack in a column. Inner edges lose their border and radius the same way they do in a horizontal group, so the column reads as a single unit.

Size

ButtonGroup has no size prop. Each child Button keeps its own height from the size prop documented on the Button page.

The preview above renders at the web size scale. On iOS and Android the child button applies the larger dp values.

Child sizeHeight
xs40dp
sm44dp
default48dp
lg51dp

Icon-only children use the icon size system. Width matches height.

Child icon sizeDimensions
icon-xs40×40
icon-sm44×44
icon48×48
icon-lg51×51

The group does not enforce size. Mixing sm, default, and lg inside the same group is allowed. Inner edges lose border and radius regardless of child size.

Separator

ButtonGroupSeparator renders a transparent 1dp gap between adjacent children, letting the page background show through. Use it when two actions should read as distinct units without a visible divider line.

Split

Combine a labeled action with a related icon-only action inside one group. The separator gives each half its own tap target while the group reads as a single unit.

API Reference

ButtonGroup

PropTypeDefaultDescription
orientation
horizontalvertical
horizontalLayout direction of the group.
classNamestring—Additional NativeWind classes merged with the group classes.
styleViewStyle—Inline style override, merged after the computed group style.

ButtonGroupText

PropTypeDefaultDescription
childrenReactNode—String or number children are wrapped in Text with the group foreground color. Other children render as-is.
classNamestring—Additional NativeWind classes.
styleViewStyle—Inline style override.

ButtonGroupSeparator

Renders a transparent gap between adjacent children. Applies marginVertical: 1 and stretches to the group height. Accepts every Separator prop.

Accessibility

  • Each child button keeps its own accessibilityRole="button" and accessibilityState. The group does not override them.
  • Icon-only children should set accessibilityLabel. The group does not synthesize one.
  • Visual size equals tap area. Groups of xs and sm buttons fall below the 44dp iOS minimum. Prefer default or lg for touch-critical actions.

Best Practices

  • Group actions that belong to the same task. Archive and Report belong together. Archive and Delete do not.
  • Keep group size uniform. Mixing sm and lg inside a group reads as a bug, not a feature.
  • Use ButtonGroupSeparator sparingly. The default border merge is enough for most cases.
  • Nested groups need the outer ButtonGroup. The outer wrapper adds the gap between inner groups and keeps the composition readable.

Platform notes

  • Border merge is inline. Native does not have CSS child selectors. ButtonGroup clones its direct children and sets borderRadius and borderWidth on the inner edges. This works for Button, ButtonGroupText, and any child that accepts a style prop.
  • Dropdown, Input, Input Group, and Select demos are web-only for now. The web Button Group page shows those compositions. Native ports are pending. The ButtonGroup API is identical and works with any child that renders a tappable surface.
  • The hero example uses three nested groups. The web hero includes a dropdown trigger inside the third group. Native renders a plain button there because DropdownMenu is not ported yet. The nesting and group composition are otherwise identical.
  • Separator is transparent on native. The web ButtonGroupSeparator renders bg-input (a subtle divider line). Native drops the line and lets the page background show through, so the gap reads as a darker separation in dark mode and a subtle one in light mode. The layout matches web: 1dp wide, stretched to the group height, with 1dp vertical margin.
  • Button: the base button used inside groups
  • Separator: the divider used between buttons
  • Theming: customize colors and borders