# Action Row

Buttons that share a row's width equally, 8 px apart, with their content centred: one full-width button, or two side by side. The size lives on the row, so every button and split button in it matches. The row stops at 384 px.

- Beta: ready to use; its API can still change in a minor release.
- Category: Actions

```tsx
import { ActionRow } from "@leap-crm/design-system";
```

## Best practices

- Do: Use it for one full-width action or two side by side in a narrow column, like New Opportunity under a contact, or Edit and Delete beneath it.
- Do: Set `size` on the row, not on the buttons inside, so every button and split button in it shares one height. A split button takes the row's size like any button.
- Do: Keep at most one primary `Button` in a row, on the main action, with an `outline` button beside it, like Cancel and Save.
- Don't: Put more than two buttons in one row. Equal widths suit one or two; move the rarer actions into a `SplitButton` menu.
- Don't: Use it in a toolbar or a table row, where buttons should size to their labels. Use `ButtonGroup` or `Toolbar` there.

## Related

- [Button](./button.md)
- [Button Group](./button-group.md)

## Examples

What the examples import:

```tsx
import { ListPlus, Pencil, PhoneCall, Plus, Trash2 } from "lucide-react";
import { ActionRow, Button, SplitButton, SplitButtonAction, SplitButtonMenu } from "@leap-crm/design-system";
```

### Contact column

The contact column's rows: New Opportunity full width at md, then Add and Interaction split buttons and Edit / Delete at sm.

```tsx
<div className="flex w-72 flex-col gap-2">
  <ActionRow>
    <Button intent="outline" icon={<Plus />}>
      New Opportunity
    </Button>
  </ActionRow>
  <ActionRow size="sm">
    <SplitButton aria-label="Add">
      <SplitButtonAction icon={<ListPlus />}>Add</SplitButtonAction>
      <SplitButtonMenu aria-label="More ways to add" />
    </SplitButton>
    <SplitButton aria-label="Interaction">
      <SplitButtonAction icon={<PhoneCall />}>
        Interaction
      </SplitButtonAction>
      <SplitButtonMenu aria-label="More interactions" />
    </SplitButton>
  </ActionRow>
  <ActionRow size="sm">
    <Button intent="outline" icon={<Pencil />}>
      Edit
    </Button>
    <Button intent="outline" icon={<Trash2 />}>
      Delete
    </Button>
  </ActionRow>
</div>
```

### Sizes

md 36 and sm 32, set on the row, never on the buttons inside. On a wide page the row stops at 384 px.

```tsx
<div className="flex w-full flex-col gap-2">
  <ActionRow size="md">
    <Button intent="outline">Cancel</Button>
    <Button>Save</Button>
  </ActionRow>
  <ActionRow size="sm">
    <Button intent="outline">Cancel</Button>
    <Button>Save</Button>
  </ActionRow>
</div>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `ButtonSize` | `"md"` | Every button's and split button's size in the row, from Button's scale: md 36 (the default) or sm 32 in a column. |
| `children` (required) | `ReactNode` |  | What it shows inside. |
| `className` | `string` |  | Classes added to the root element, merged with its own. Tokens only. |
