- Accordion
- Attachment
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Code Block
- Collapsible
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Label
- Marker
- Message
- Number Flow
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Slider
- Sonner
- Spinner
- Switch
- Tooltip
- Separator
- Sheet
- Tabs
- Textarea
- Toggle
- Toggle Group
- Trace
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
$ bunx --bun frakment add button-group --expo$ npx frakment add button-group --expo$ pnpm dlx frakment add button-group --expo$ yarn dlx frakment add button-group --expo
Install the following dependencies:
$ bun add class-variance-authority clsx tailwind-merge lucide-react-native$ npm install class-variance-authority clsx tailwind-merge lucide-react-native$ pnpm add class-variance-authority clsx tailwind-merge lucide-react-native$ yarn add class-variance-authority clsx tailwind-merge lucide-react-native
Configure NativeWind in your Expo project.
Skip this step if your project already uses NativeWind v5. The project needs a babel.config.js with babel-preset-expo, a metro.config.js wrapped with withNativewind, and a global.css that imports tailwindcss/theme.css, tailwindcss/utilities.css, and nativewind/theme. Import global.css in the root layout.
Copy lib/utils.ts into your project.
Copy lib/theme.ts into your project.
Copy separator into your project.
Button Group imports Separator. Install it first from the Separator page.
Copy the button group into your project.
Update the import paths to match your project setup.
Usage
import { Button } from "@/components/ui/button";
import { ButtonGroup } from "@/components/ui/button-group";<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 size | Height |
|---|---|
xs | 40dp |
sm | 44dp |
default | 48dp |
lg | 51dp |
Icon-only children use the icon size system. Width matches height.
Child icon size | Dimensions |
|---|---|
icon-xs | 40×40 |
icon-sm | 44×44 |
icon | 48×48 |
icon-lg | 51×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
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | horizontalvertical | horizontal | Layout direction of the group. |
className | string | — | Additional NativeWind classes merged with the group classes. |
style | ViewStyle | — | Inline style override, merged after the computed group style. |
ButtonGroupText
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | String or number children are wrapped in Text with the group foreground color. Other children render as-is. |
className | string | — | Additional NativeWind classes. |
style | ViewStyle | — | 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"andaccessibilityState. 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
xsandsmbuttons fall below the 44dp iOS minimum. Preferdefaultorlgfor 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
smandlginside a group reads as a bug, not a feature. - Use
ButtonGroupSeparatorsparingly. 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.
ButtonGroupclones its direct children and setsborderRadiusandborderWidthon the inner edges. This works forButton,ButtonGroupText, and any child that accepts astyleprop. - 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
ButtonGroupAPI 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
ButtonGroupSeparatorrendersbg-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.