Appica UIUI 1.0.0

Button Group

Groups related buttons into a single segmented control, sharing variant, size, and state.

Usage

ButtonGroup is a thin wrapper around your existing Buttons. It collapses the inner corners and borders into one seamless control and shares variant, size, and disabled with every child through React context — so you set them once on the group instead of repeating them on each button.

Examples

Variants

Set variant on the group and every Button inherits it. Outlined variants (outline, primary-outline, light) overlap their shared borders so the seam stays a single hairline.

Sizes

size cascades to the children too. Use it to scale the whole control at once.

Vertical orientation

Set orientation="vertical" to stack the buttons; the group rounds the top and bottom of the stack instead of the left and right ends.

Icon buttons

Pair an icon-* size with icon-only buttons to build a compact toolbar. Give each button an aria-label since there's no visible text.

Split button

A common pattern: a primary action joined to a dropdown menu of related actions. The menu trigger is rendered as a Button, so it still inherits the group's variant through context even though it's nested inside DropdownMenu.

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.

For setup details and caveats, see the RTL guide.

API reference

ButtonGroup renders a <div role="group"> and forwards every other prop (id, aria-*, ref, …) to it. Each child reads variant, size, and disabled from group context — a value set directly on a Button always overrides the group, except disabled, which is additive (the group disabling can't be overridden by a child).

Accessibility

  • Renders a <div role="group"> so assistive tech announces the buttons as one related set. Add an aria-label or aria-labelledby to name the group when its purpose isn't clear from context.
  • Each child remains a standalone Button, so focus order, Tab, Enter, and Space behave exactly as they do for a lone button.
  • Icon-only buttons have no text — give each one an aria-label.
  • disabled on the group removes every child from the tab order and sets data-disabled for styling.

© 2026 Appica UI. A free component library, crafted by the Appica team.