---
title: "Action Bar"
description: "A bar that floats at the bottom of the screen while you select rows. It shows the count, the bulk actions, and a clear button. Escape clears the selection."
url: https://gelatinui.com/components/action-bar
markdown_url: https://gelatinui.com/components/action-bar.md
access: free
install: "npx shadcn@latest add @gelatin-ui/action-bar"
registry_item: https://gelatinui.com/r/action-bar.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Action Bar

> A bar that floats at the bottom of the screen while you select rows. It shows the count, the bulk actions, and a clear button. Escape clears the selection.

Page: https://gelatinui.com/components/action-bar

## When to use it

Best for: Bulk actions on the selected rows of a list, a table, or a grid, without a change of layout.

- Bind `open` to the selection (`open={selected.size > 0}`) and clear the selection in `onClear`.
- Put `ActionBarContent` right after the list it acts on, so the bar sits there in Tab order.
- Put the actions in `ActionBarOverflow`, so they fold into a More menu on a narrow screen.
- Add `actionBarReserveVariants()` to the end of a page that ends with the list, so the last row can scroll clear of the bar.

## When not to use it

- For actions that show at all times, with no selection, use a [Toolbar](https://gelatinui.com/components/toolbar.md).
- For a message that confirms an action after it ran, use a [Toast](https://gelatinui.com/components/toast.md).

## Notes for agents

- The bar never takes focus when it opens. Give `actionsRef` and call `focus()` for an app shortcut such as F6.
- The close button and Escape call `onClear`, then `onOpenChange(false, { reason })` with `clear` or `escape`.
- Set `finalFocus` when an action removes the rows that had focus, such as Delete.
- Give `ActionBarSelection` a `widestText` ("6 selected"), so the bar does not change width when the count changes.

## Anatomy

```text
ActionBar
├─ ActionBarContent (0..n)
├─ ActionBarSelection (0..n)
├─ ActionBarGroup (0..n)
├─ ActionBarButton (0..n)
├─ ActionBarOverflow (0..n)
├─ ActionBarLink (0..n)
├─ ActionBarInput (0..n)
├─ ActionBarSeparator (0..n)
└─ ActionBarClose (0..n)
```

## API reference

### ActionBar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  |  |
| `open` | `boolean` |  | The open state (controlled). Bind it to the selection: `open={selected.size > 0}`. |
| `defaultOpen` | `boolean` | false | The open state on the first render (uncontrolled). |
| `onOpenChange` | `function` |  | Called when the bar closes from inside (the close button or Escape), with the reason. |
| `onClear` | `function` |  | Called first when the user clears from the bar. Clear the selection here. |
| `actionsRef` | `RefObject<{ focus: () => void; } \| null>` |  | Gives `focus`, which moves focus into the bar. Use it for an app shortcut (F6). |
| `finalFocus` | `RefObject \| function` |  | Where focus goes when the bar closes while focus is in it, if the element that had focus before the bar is gone (the rows that a Delete removed). By default: the element before the bar in Tab order. |
| `labels` | `Partial<typeof ACTION_BAR_LABELS>` |  | The words of the parts (`ACTION_BAR_LABELS`). Keep the object stable. |

### ActionBarContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `container` | `HTMLElement \| null` |  | Where the bar renders. By default, the end of `<body>`. In a modal Dialog or Drawer, pass its popup element: outside it, the bar is behind the focus trap and hidden from screen readers. |

Also takes every prop of Base UI `Toolbar.Root`: https://base-ui.com/react/components/toolbar

### ActionBarSelection

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `widestText` | `ReactNode` |  | The widest text this part shows, such as the text of the total (`"248 selected"`). The part keeps room for it, so the buttons do not move when "9 selected" turns into "10 selected". Without it, the width follows the text. |

### ActionBarGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Toolbar.Group`: https://base-ui.com/react/components/toolbar

### ActionBarButton

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` | "sm" |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` | "ghost" |  |
| `className` | `string` |  |  |
| `unstyled` | `boolean` |  | Drop the Button look and keep only `className`. Use it when `render` mounts a component with its own look (a Toggle, a ToggleGroupItem, a SelectTrigger), or the two looks mix. |
| `chevron` | `boolean` |  | Add a chevron after the content, for a button that opens a menu, a select, or a popover with its current value in front ("Heading 1", a list icon, the color "A"). See the JSDoc of `ToolbarButton`. Default `false`. |
| `busy` | `boolean` | false | Shows a spinner in the leading slot, sets `aria-busy`, and blocks clicks; focus stays (our Button `busy`). Not with `render`: a Menu trigger has no busy state. |

Also takes every prop of Base UI `Toolbar.Button`: https://base-ui.com/react/components/toolbar

### ActionBarOverflow

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `collapseFrom` | `OverflowCollapseFrom` |  | Where items fold: `end` (default) keeps the first ones, `start` keeps the last ones. |
| `minVisible` | `number` |  | Items that always show, even when they do not fit. A kept item that does not fit gets `data-forced` (an `OverflowListItem` then may shrink and cut its text). Use 1 for labels and paths, so the row never shows "+6" alone. Default 0. |
| `locale` | `string` |  | Formats the count with `Intl.NumberFormat` ("ar-EG": "+٣"). Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `labels` | `Partial<{ more: string; }>` |  | The words (`OVERFLOW_LIST_LABELS`). Keep the object stable. |
| `items` | `readonly Item[]` |  | The actions, in order. The ones that do not fit go into "More", from the end. |
| `itemKey` | `function` |  | A stable key for each action (an id), unique in `items` (see `OverflowList` `itemKey`). |
| `renderItem` | `function` |  | One action in the bar: return one `ActionBarButton` (or a Tooltip or Menu around one). |
| `renderMenuItem` | `function` |  | The same action as a row of the "More" menu: return one `MenuItem`. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### ActionBarLink

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |

### ActionBarInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "lg" \| "sm" \| "xs"` |  |  |
| `surface` | `"default" \| "group"` |  |  |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Toolbar.Input`: https://base-ui.com/react/components/toolbar

### ActionBarSeparator

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Toolbar.Separator`: https://base-ui.com/react/components/toolbar

### ActionBarClose

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` | "icon-sm" |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `unstyled` | `boolean` |  | Drop the Button look and keep only `className`. Use it when `render` mounts a component with its own look (a Toggle, a ToggleGroupItem, a SelectTrigger), or the two looks mix. |
| `chevron` | `boolean` |  | Add a chevron after the content, for a button that opens a menu, a select, or a popover with its current value in front ("Heading 1", a list icon, the color "A"). See the JSDoc of `ToolbarButton`. Default `false`. |

Also takes every prop of Base UI `Toolbar.Button`: https://base-ui.com/react/components/toolbar

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ActionBarContent | `action-bar-focus-guard` |  |  |  |
| ActionBarSelection | `action-bar-selection` |  |  |  |
| ActionBarGroup | `action-bar-group` |  |  |  |
| ActionBarButton | `action-bar-button` |  |  |  |
| ActionBarOverflow | `action-bar-overflow` |  | `--overflow-list-natural-width` |  |
| ActionBarLink | `action-bar-link` |  |  |  |
| ActionBarInput | `action-bar-input` |  |  |  |
| ActionBarSeparator | `action-bar-separator` |  |  |  |
| ActionBarClose | `action-bar-close` |  |  |  |

## Usage

Bind `open` to the selection and clear it in `onClear`. Put the content right after the list.

```tsx title="file-list-actions.tsx"
import { DownloadIcon, TrashIcon } from "@phosphor-icons/react/ssr";
import { useState } from "react";

import {
  ActionBar,
  ActionBarButton,
  ActionBarClose,
  ActionBarContent,
  ActionBarSelection,
  ActionBarSeparator,
} from "@/components/actions/action-bar";

export function FileListActions() {
  const [selected, setSelected] = useState(new Set(["q3-deck", "launch-plan"]));
  return (
    <ActionBar open={selected.size > 0} onClear={() => setSelected(new Set())}>
      <ActionBarContent>
        <ActionBarSelection>{selected.size} selected</ActionBarSelection>
        <ActionBarSeparator />
        <ActionBarButton>
          <DownloadIcon /> Download
        </ActionBarButton>
        <ActionBarButton variant="destructive">
          <TrashIcon /> Delete
        </ActionBarButton>
        <ActionBarSeparator />
        <ActionBarClose />
      </ActionBarContent>
    </ActionBar>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/action-bar
```

It adds 54 registry items: 50 files, 9619 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Button](https://gelatinui.com/components/button.md)
- [Menu](https://gelatinui.com/components/menu.md)
- [Overflow List](https://gelatinui.com/components/overflow-list.md)
- [Portal](https://gelatinui.com/components/portal.md)
- [Toolbar](https://gelatinui.com/components/toolbar.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Toolbar](https://gelatinui.com/components/toolbar.md)
- [Overflow List](https://gelatinui.com/components/overflow-list.md)
- [Checkbox](https://gelatinui.com/components/checkbox.md)
- [Table](https://gelatinui.com/components/table.md)
- [Toast](https://gelatinui.com/components/toast.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab, Shift+Tab | Moves into the bar from the list before it or the control after it. The bar is one Tab stop. |
| ← → | Moves between the actions of the bar. |
| Home, End | Moves to the first or the last action. |
| Escape | Clears the selection and closes the bar. Focus goes back to where it was before the bar. |

## Accessibility

The bar is a toolbar in a landmark named "Bulk actions". The count names the toolbar, so focus that comes in reads "3 selected, toolbar".

The bar sits in Tab order where `ActionBarContent` is in the code: two focus guards hold its place, and they take no space.

When the bar closes with focus in it, focus goes back to the element that had it before, or to `finalFocus`.

## Motion

| Part | Motion |
| --- | --- |
| Open | overlay · 200ms · ease-panel · rises 12px and fades in |
| Close | overlay-exit · 150ms · fades out |
