Action Bar
A floating contextual toolbar that slides up for bulk-selection actions, dismissable by button or Escape.
Preview
Controls
Device view renders in an isolated frame so real responsive breakpoints apply. Switch to Full for overflowing popovers.
Installation
php artisan ui:add action-bar
Behavior layer (Alpine)
This component installs a self-registering Alpine module to
resources/js/ui/action-bar.js. Import the behavior layer once
from your bundle so it loads (it hooks alpine:init):
import './action-bar.js';
Registry contract
Install confidence
php artisan ui:add action-bar
writes only the generated targets below. The CLI validates each file hash before writing and
prompts before replacing local changes unless --force is used.
- Version
- 1.0.0
- License
- open
- Stability
- stable
- Contract
- v2
- Foundation
- ≥ 1.0.0
| Type | Generated target |
|---|---|
| blade | resources/views/components/ui/action-bar.blade.php |
| js | resources/js/ui/action-bar.js |
Registry dependencies
None.
Package dependencies
composer: jml/brok:^1.0
npm: alpinejs
Guidance
Secondary action menuProvide compact access to secondary actions.
Use when
- Use for secondary actions when compact access is more important than constant visibility. Do not hide the most frequent or highest-value actions in a menu when discoverability matters.
Avoid when
- Avoid using action-bar as a default simply because it is available in the library. Choose it only when its interaction cost, visibility, and behavior match the job to be done.
- Task length
- micro
- Interaction cost
- medium
- Interruptiveness
- none
- Input precision
- none
- Mobile / touch risk
- medium
- Accessibility risk
- high
- Needs background context
- Yes
- Comparison needed
- No
Preferred alternatives
- Visible button for frequent actions
- Inline action bar
Anti-patterns
- Hiding primary actions in menus
API
manifest knowledge + registry-derived coverageProps
| Prop | Type / values | Default | Description |
|---|---|---|---|
| open | bool | false | Declared by @props in the registry Blade source. |
| count | int | 0 | Declared by @props in the registry Blade source. |
| label | string | selected | Declared by @props in the registry Blade source. |
Slots
default— Primary Blade slot rendered by the component.
Data slots
action-bar
Capabilities
Behavior
- Uses server-rendered Blade and semantic HTML.
- Installs a JavaScript behavior module when the registry item includes resources/js/ui files.
- Declares registry capability flags: a11y, interactive, responsive, rtl, darkMode.
Usage
<div
x-data="{ barOpen: false }"
class="flex min-h-[220px] items-start justify-center pt-10"
>
{{-- Trigger button --}}
<button
type="button"
@click="barOpen = true"
class="inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none"
>
{{ __('Select 3 items') }}
</button>
{{-- Action Bar --}}
<x-ui.action-bar
:open="false"
:count="3"
x-bind:class="barOpen ? '' : 'pointer-events-none'"
x-init="$watch('barOpen', v => v ? show(3) : hide())"
>
{{-- Archive action --}}
<button
type="button"
class="inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-xs font-medium text-popover-foreground transition-colors hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="h-3.5 w-3.5" aria-hidden="true">
<path d="M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2.75 7a.75.75 0 0 0 0 1.5h10.5a.75.75 0 0 0 0-1.5H2.75ZM2 11.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z" />
</svg>
{{ __('Archive') }}
</button>
{{-- Delete action --}}
<button
type="button"
class="inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-xs font-medium text-destructive transition-colors hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="h-3.5 w-3.5" aria-hidden="true">
<path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.712Z" clip-rule="evenodd" />
</svg>
{{ __('Delete') }}
</button>
</x-ui.action-bar>
</div>
Accessibility & localization
data-slot
Keyboard focus-visible
Localized labels
- Accessibility target: wcag-2.2-aa-target.
- Uses semantic HTML and a stable
data-slotattribute for styling/scripting hooks. - Focus-visible rings use the
ringtoken so keyboard focus is always visible. - Disabled and invalid states are conveyed to assistive tech, not by color alone.
- Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces above.
- Labels go through
__()and the component uses logical properties (ms-*,text-start,start-*) so it mirrors correctly — flip the preview to RTL to confirm.
Source
The exact, editable file ui:add writes
into your app — copy it or own the whole thing. Previews
render this same code; there are no preview-only components.
Changelog
Current version: v1.0.0. See the site changelog for the full release history.