Expandable Action Bar

Overview

Compact icon actions that expand into labeled controls on hover or focus with shared layout motion.

This action component is intended for interfaces that need compact icon actions that expand into labeled controls on hover or focus with shared layout motion, SaaS workflows, and onboarding flows. Its implementation is provided as editable source so the final behavior and styling stay inside your project.

Technologies

React
TypeScript
Tailwind CSS
Motion

Detected package dependencies: motion, clsx, tailwind-merge.

@spectrumui/expandable-action-bar

Hover or focus the bar — the icons expand into labeled controls.

Installation

Login to view commandCreate a free account to access the install command

Usage

import { ExpandableActionBar } from "@/components/motion/expandable-action-bar"
<ExpandableActionBar
  items={[
    { id: "edit", label: "Edit", icon: <Pencil className="size-4" />, shortcut: "E" },
    { id: "share", label: "Share", icon: <Share2 className="size-4" /> },
  ]}
  onAction={(item) => run(item.id)}
/>

API Reference

ExpandableActionBar

beUI's Expandable Action Bar block (beui.dev, MIT), installed from its shadcn registry into components/motion with its gesture hooks. Icons expand into labeled controls on hover or focus; on touch the first tap expands and the second acts.

PropTypeDefaultDescription
*itemsExpandableActionBarItem[]-Actions: { id, label, icon, onClick?, disabled?, active?, badge?, shortcut? }
expandedboolean-Controlled expanded state
defaultExpandedboolean-Initial expanded state when uncontrolled
onExpandedChange(expanded: boolean) => void-Fires when the bar expands or collapses
activeIdstring-Id of the highlighted action
onAction(item: ExpandableActionBarItem) => void-Fires when an action is triggered
size"sm" | "md""md"Control size
expandOnHoverbooleantrueExpand when a hovering pointer rests on the bar
expandOnFocusboolean-Expand when a control receives focus
collapseDelaynumber-Delay in ms before collapsing after leave
renderItem(item, state) => ReactNode-Custom renderer for an action
classNamestring-Classes for the bar

Use cases

  • interfaces that need compact icon actions that expand into labeled controls on hover or focus with shared layout motion
  • SaaS workflows
  • onboarding flows

Features

  • Copy-paste source that remains in your repository
  • TypeScript source included with the component
  • Tailwind CSS classes editable in the component source
  • Animation implemented with Motion
  • Responsive Tailwind variants present in the source
  • Reduced-motion handling present in the source

Accessibility

  • The source includes ARIA attributes or roles; preserve them when customizing the component.
  • The source includes keyboard event handling; verify it alongside pointer behavior.
  • The source checks reduced-motion preferences or includes motion-reduce styles.
  • Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.

Customization

  • Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
  • Use the documented className surface for local layout adjustments, then edit the source for structural changes.
  • Adjust Motion transitions in the source and keep the reduced-motion behavior aligned with the final interaction.

Expandable Action Bar FAQ

Is Expandable Action Bar free to use in commercial projects?

Yes. The public Expandable Action Bar source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.

How do I install Expandable Action Bar?

Run npx shadcn@latest add @spectrumui/expandable-action-bar. The page also exposes the source for manual installation.

Does Expandable Action Bar require Motion?

Yes. Motion usage was detected in the documented source or registry dependencies for Expandable Action Bar.

Does Expandable Action Bar use shadcn/ui or Radix UI?

No shadcn/ui or Radix UI dependency was detected in the documented Expandable Action Bar source.

Can I use Expandable Action Bar in Next.js?

The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.

What accessibility checks should I run for Expandable Action Bar?

The source includes ARIA markup, keyboard handlers, reduced-motion handling. Test the finished interface with keyboard and screen-reader workflows.

Work with me