# Button Group (/buttons/button-group)





<ComponentPreview name="button-group-preskok-demo" description="Group related buttons together." />

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger id="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger id="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent id="cli">
    ```bash
    npx shadcn@latest add @preskok/button-group
    ```
  </TabsContent>

  <TabsContent id="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.

        <ComponentSource name="button-group" title="registry/preskok/ui/preskok-ui/button-group.tsx" />
      </Step>

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Usage [#usage]

```tsx
import { Button } from "@/components/ui/preskok-ui/button"
import { ButtonGroup } from "@/components/ui/preskok-ui/button-group"

export function ButtonGroupDemo() {
  return (
    <ButtonGroup>
      <Button intent="secondary">Down</Button>
      <Button intent="secondary">Up</Button>
    </ButtonGroup>
  )
}
```

## Examples [#examples]

### Complete Example [#complete-example]

<ComponentPreview name="button-group-preskok-demo" description="Button group with different orientations and mixed intents." />

### Vertical Orientation [#vertical-orientation]

<ComponentPreview name="button-group-orientation-demo" description="Button group with vertical orientation." />

### With Menu [#with-menu]

<ComponentPreview name="button-group-with-menu-demo" description="Button group combined with a dropdown menu." />

### With Text [#with-text]

<ComponentPreview name="button-group-with-text-demo" description="Button group with a text label." />

## Props [#props]

### ButtonGroup [#buttongroup]

| Prop          | Type                         | Default        | Description                   |
| ------------- | ---------------------------- | -------------- | ----------------------------- |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Direction of button alignment |
| `className`   | `string`                     | -              | Additional CSS classes        |

### ButtonGroupText [#buttongrouptext]

| Prop        | Type     | Default | Description            |
| ----------- | -------- | ------- | ---------------------- |
| `className` | `string` | -       | Additional CSS classes |
