--- title: MazBtnGroup description: MazBtnGroup is a component to group multiple MazBtn buttons together with seamless styling. Supports props-based or slot-based rendering with customizable orientation, size, and color. --- # {{ $frontmatter.title }} {{ $frontmatter.description }} ## Basic usage with items Use the `items` prop to quickly create a button group from an array of button configurations. ## Slot-based usage Use the default slot to pass `MazBtn` components directly for full control over each button. Edit Save Delete ## Orientation Use the `orientation` prop to arrange buttons horizontally (`row`) or vertically (`col`).

Row (default)

Column

## Sizes Use the `size` prop to apply a size to all buttons in the group.
## Colors Use the `color` prop to apply a color to all buttons in the group. Neutral colors (`surface`, `container`) are supported, see the [surface vs container tip](./maz-btn.md#colors).
## Button variants Use the `outlined` or `pastel` properties on individual buttons or apply different variants to buttons in the group. ### Outlined
### Pastel
### Slot-based variants
Edit Save Delete Edit Save Delete
## Click handlers Add click handlers to buttons using the `onClick` property in items. ## With icons Use the `startIcon` or `endIcon` properties to add icons to buttons.

## With links Use the `href` or `to` properties to create link buttons. ## Mixed button styles Combine different button styles within the same group. ## Types ### MazButtonGroupOption ```ts import type { MazBtnProps } from 'maz-ui/components/MazBtn' import type { RouteLocationRaw } from 'vue-router' interface MazButtonGroupOption extends Omit { /** The text of the button */ text: string /** Click handler for the button */ onClick?: () => void /** The href for anchor links */ href?: string /** The route for router-link */ to?: RouteLocationRaw } ``` ### MazButtonGroupProps ```ts interface MazButtonGroupProps { /** * The items for the button group (optional when using slot-based approach) * @default undefined */ items?: MazButtonGroupOption[] /** * The orientation of the button group * @values 'row' | 'col' * @default 'row' */ orientation?: 'row' | 'col' /** * The size of all buttons (only applies to props-based buttons) * @default 'md' */ size?: 'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' /** * The color of all buttons (only applies to props-based buttons) * @default 'primary' */ color?: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'destructive' | 'transparent' | 'contrast' | 'accent' | 'surface' | 'container' } ```