Action Bar
A floating toolbar for contextual actions — bulk selection, editing controls, or any set of actions that appear in response to user interaction.
Usage
"use client";
import { useState } from "react";
import { ActionBar } from "@thenamespace/uikit";The ActionBar component is a floating pill-shaped toolbar that animates in/out based on the isOpen prop. It uses a Prefix / Content / Suffix structure.
Combine with ListView for bulk selection rows.
With Data Grid
| Employee | Department | Status | Joined | |
|---|---|---|---|---|
AO Amara Okaforamara.okafor@company.com | Sales | Pending | Jun 27, 2024 | |
ER Elena Rodriguezelena.rodriguez@company.com | Product | Active | Jan 28, 2024 | |
JO James O'Brienjames.o.brien@company.com | Support | Active | Apr 14, 2024 | |
LB Luca Bianchiluca.bianchi@company.com | Engineering | Active | Jul 25, 2024 | |
MC Marcus Chenmarcus.chen@company.com | Design | Pending | Feb 3, 2024 | |
PP Priya Patelpriya.patel@company.com | Product | Active | Mar 4, 2024 | |
SA Sofia Anderssonsofia.andersson@company.com | Design | Active | Aug 8, 2024 | |
YT Yuki Tanakayuki.tanaka@company.com | Support | Inactive | May 8, 2024 |
"use client";
import { useCallback, useMemo, useState } from "react";
import { ActionBar } from "@thenamespace/uikit";Combine with DataGrid for bulk selection workflows. The ActionBar appears when rows are selected and provides contextual actions like edit, export, archive, or delete.
Anatomy
import { ActionBar } from "@thenamespace/uikit";
import { Button, Chip, Separator, Tooltip } from "@thenamespace/uikit";
<ActionBar isOpen={hasSelection}>
<ActionBar.Prefix>
<Chip size="sm">{count}</Chip>
</ActionBar.Prefix>
<Separator />
<ActionBar.Content>
<Button size="sm" variant="ghost">
Edit
</Button>
<Button size="sm" variant="ghost">
Export
</Button>
</ActionBar.Content>
<Separator />
<ActionBar.Suffix>
<Tooltip>
<Button
isIconOnly
aria-label="Clear"
size="sm"
variant="ghost"
onPress={onClear}
>
<Xmark />
</Button>
<Tooltip.Content>Clear selection</Tooltip.Content>
</Tooltip>
</ActionBar.Suffix>
</ActionBar>;All three sections (Prefix, Content, Suffix) are optional. Use Separator from @thenamespace/uikit between sections as needed.
Responsive Labels
Use the action-bar__label CSS class on any text you want hidden on mobile. Below the sm breakpoint (640px), elements with this class become sr-only — buttons collapse to icon-only while remaining accessible.
<Button aria-label="Edit" size="sm" variant="ghost">
<Pencil />
<span className="action-bar__label">Edit</span>
</Button>CSS Classes
Base Classes
.action-bar— Outer positioning wrapper. Fixed to viewport bottom-center withpointer-events: none..action-bar__wrapper— The visible pill surface. Restorespointer-events: auto, applies shadow.
Element Classes
.action-bar__prefix— Leading section (badges, counts)..action-bar__content— Middle section for main actions..action-bar__suffix— Trailing section (dismiss button)..action-bar__label— Text that collapses tosr-onlybelow 640px.
API Reference
ActionBar
The root component. Extends ToolbarProps from @thenamespace/uikit.
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | — | Controls visibility with animated enter/exit. Required. |
aria-label | string | "Actions" | Accessible label for the toolbar. |
isAttached | boolean | true | Whether the toolbar has a surface background with full rounding. |
orientation | "horizontal" | "vertical" | "horizontal" | The orientation of the toolbar. |
className | string | — | Additional CSS classes applied to the toolbar wrapper. |
children | ReactNode | — | Content — typically Prefix, Content, Suffix, and Separator components. |
ActionBar.Prefix
Leading section container.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Content for the leading section (badges, counts, labels). |
className | string | — | Additional CSS classes. |
ActionBar.Content
Middle section container for main actions.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Action buttons, dropdowns, etc. |
className | string | — | Additional CSS classes. |
ActionBar.Suffix
Trailing section container.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Dismiss button, secondary actions. |
className | string | — | Additional CSS classes. |