Skip to content
Harness Design System Harness Design System Harness Design System

ButtonGroup

The ButtonGroup component allows you to group multiple buttons together, either horizontally or vertically. It is useful for organizing related actions.

Usage

import { Button, ButtonGroup } from '@harnessio/ui/components'
//...
return (
<ButtonGroup>
<Button>Button 1</Button>
<Button>Button 2</Button>
<Button>Button 3</Button>
</ButtonGroup>
)

API Reference

<ButtonGroup
direction="horizontal" // [OPTIONAL] Direction of the button group, can be 'horizontal' or 'vertical'
className="custom-class" // [OPTIONAL] Custom class name
spacing="4" // [OPTIONAL] Spacing between the buttons
verticalAlign="center" // [OPTIONAL] Vertical alignment of the buttons when the direction is set to vertical
>
{/* Buttons */}
</ButtonGroup>
PropRequiredDefaultType
childrentrueReactNode
directionfalsehorizontal'horizontal' | 'vertical'
classNamefalsestring
spacingfalse4string
verticalAlignfalsestring