Action Bar
ActionBar is a fixed floating toolbar that appears at the top or bottom of the screen, used to surface contextual actions when items are selected.
import { RiDeleteBinLine, RiDownloadLine, RiMoreFill } from '@remixicon/react';
import { ActionBar } from '@/components/ui/wideset/action-bar/ActionBar';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
<ActionBar isOpen amountSelected={3} onClose={clearSelection}>
<IconButton preset="border" variant="secondary" size="sm" icon={RiDownloadLine} aria-label="Download" />
<IconButton preset="border" variant="danger" size="sm" icon={RiDeleteBinLine} aria-label="Delete" />
<IconButton preset="border" variant="secondary" size="sm" icon={RiMoreFill} aria-label="More actions" />
</ActionBar>Installation
pnpm dlx wideset add action-bar
Copies the component and any Wideset components it uses into your project.
Examples
Positions
bottom (the default) keeps the bar out of the way of the table header and the page title; use top when something else already sits at the bottom of the screen, such as a cookie banner or a chat button. The bar is fixed to the viewport: each box here contains it only so the example stays on the card.
import { RiDeleteBinLine, RiDownloadLine } from '@remixicon/react';
import { ActionBar } from '@/components/ui/wideset/action-bar/ActionBar';
import { Button } from '@/components/ui/wideset/button/Button';
export default function ActionBarPositions() {
return (
<div className="gap-ws-9 flex w-[30rem] max-w-full flex-col">
{(['bottom', 'top'] as const).map((position) => (
<div
key={position}
className="rounded-ws-control-lg border-ws-static-base relative h-[9rem] [transform:translateZ(0)] overflow-hidden border"
>
<ActionBar isOpen position={position} amountSelected={3} onClose={() => {}}>
<Button preset="border" variant="secondary" size="sm">
<Button.Icon icon={RiDownloadLine} />
Download
</Button>
<Button preset="border" variant="danger" size="sm">
<Button.Icon icon={RiDeleteBinLine} />
Delete
</Button>
</ActionBar>
</div>
))}
</div>
);
}Alignments
center (the default) suits a full-width table. Align the bar left or right when the selection lives in one column of the layout, such as a list beside a detail panel, so the bar stays under the items it acts on. The bar is fixed to the viewport: each box here contains it only so the example stays on the card.
import { RiDeleteBinLine } from '@remixicon/react';
import { ActionBar } from '@/components/ui/wideset/action-bar/ActionBar';
import { Button } from '@/components/ui/wideset/button/Button';
export default function ActionBarAlignments() {
return (
<div className="gap-ws-9 flex w-[36rem] max-w-full flex-col">
{(['left', 'center', 'right'] as const).map((align) => (
<div
key={align}
className="rounded-ws-control-lg border-ws-static-base relative h-[5.5rem] [transform:translateZ(0)] overflow-hidden border"
>
<ActionBar isOpen align={align} amountSelected={2} onClose={() => {}}>
<Button preset="border" variant="danger" size="sm">
<Button.Icon icon={RiDeleteBinLine} />
Delete
</Button>
</ActionBar>
</div>
))}
</div>
);
}API reference
| Name | Description | Default |
|---|---|---|
align | 'center''left''right' | 'center' |
amountSelected | Selected item count, or a count and formatter tuple for a custom selection label. number | [count: number, format: (amount: number) => ReactNode] | — |
children | Action content rendered after the close button and selected count — typically buttons or icon buttons. ReactNode | — |
closeAriaLabel | Accessible label for the close button. Defaults to `'Close'`. string | 'Close' |
defaultMotion | Turns the component's built-in animations on or off. When omitted, inherits the value from the nearest `MotionProvider`. boolean | true |
isOpen | Controls visibility of the action bar. Defaults to `false`. boolean | — |
onClose | Called when the close button is activated; clear the selection or hide the bar in response. (() => void) | — |
position | 'bottom''top' | 'bottom' |
Accessibility
- Closed, the bar is
inertand hidden from assistive tech; it cannot be tabbed into. - Icon-only actions need
aria-label. SetcloseAriaLabelto say what closing does (“Clear selection”) when “Close” is not enough.
import { RiDeleteBinLine, RiDownloadLine, RiMoreFill } from '@remixicon/react';
import { ActionBar } from '@/components/ui/wideset/action-bar/ActionBar';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
<ActionBar isOpen amountSelected={3} onClose={clearSelection}>
<IconButton preset="border" variant="secondary" size="sm" icon={RiDownloadLine} aria-label="Download" />
<IconButton preset="border" variant="danger" size="sm" icon={RiDeleteBinLine} aria-label="Delete" />
<IconButton preset="border" variant="secondary" size="sm" icon={RiMoreFill} aria-label="More actions" />
</ActionBar>