Skip to content
Bladewell
Components
Accordion
Alert
Breadcrumbs
Button
Calendar
Chat
Clock
Command palette
Dropdown
Captcha
Checkbox
Colour picker
Date picker
Date range picker
File upload
Filter builder
Image cropper
Number
OTP
Password
Phone
Radio
Repeater
Search
Select
Show if
Slider
Sortable list
Switch
Tags input
Text input
Textarea
Time picker
Verification code
Field
Icon
Kanban
Auth layout
Sidebar layout
Modal
Pagination
Popover
Price roll
Progress
Stepper
Table
Tabs
Toast
Tooltip
Tooltip cursor
Tree
Docs
Installation
Why Bladewell
For AI agents
Guides
Build a Laravel form from your validation rules
Add a date range picker to a Laravel form
Laravel data table with sorting, filters, pagination
Editable table cells in Laravel with Livewire
A Livewire modal that stays open through re-renders
Using Blade components in Livewire 3 and 4
Two-factor authentication screens for Laravel Fortify
Passkey sign-in for Laravel with Fortify
Real-time notification bell with Laravel Reverb
AI agent actions with Approve and Deny in Laravel
Laravel AI chat with Livewire and streaming replies
Livewire multi-step form with validation per step
Toast notifications in Laravel and Livewire
Livewire file upload with progress and drag and drop
Laravel searchable select that loads from the database
Laravel Blade card, avatar and empty state patterns
Add charts and a rich text editor to a Laravel app
Compare
Bladewell vs Flux: a Free Alternative for Laravel
Bladewell vs Mary UI: daisyUI or Plain Blade
Bladewell vs WireUI: With or Without Alpine
Blade UI Kit Alternative for Laravel 12 and 13
Bladewell vs BladewindUI: Laravel Blade Components
Bladewell vs Sheaf UI: With or Without Alpine
Bladewell vs April UI: Package or Copied-in Code

<x-widget.command>

Command palette Blade component for Laravel and Livewire

A command palette: Ctrl+K (Cmd+K on a Mac) opens a search box that finds pages and actions as you type, in groups. With suggest-url it adds your app's own results, and recent keeps the last few choices. Enter opens a page or clicks an action, so wire:click works.

php artisan bladewell:add command
Also adds
Icon
Works with
Laravel 12 and 13, Livewire 3 and 4, Tailwind CSS 4.1+, PHP 8.3+

Usage

In scripts

window.command is available once the command script has loaded. <x-widget.command id="palette" …>

JavaScript
command.open('palette');
command.close('palette');

// Choosing an item, for your own analytics or shortcuts.
document.addEventListener('command:chosen', (event) => console.log('Chosen:', event.detail.item.textContent.trim()));

Livewire

Inside a Livewire component, an item without href takes wire:click: choosing it by Enter or a click runs the action and closes the palette. Open it from the component with $this->dispatch('command-open', id: 'palette').

Blade
<x-widget.command id="palette" label="Search pages and actions">
    <x-widget.command.item wire:click="archiveAll" icon="inbox">Archive all read</x-widget.command.item>
    <x-widget.command.item href="/settings" icon="settings">Settings</x-widget.command.item>
</x-widget.command>

On the server

The command palette can't stop a request that skips it. Here's what to check on your server, and what to keep cheap.

Security

Server cost

  • With suggest-url, each pause in typing is a request. Throttle the route, limit() the results, and consider caching answers briefly, keyed as for search: by the query, the user and the active workspace if results depend on it; the pages and actions you list in the page itself cost nothing.

    Laravel: Rate limiting routes · Laravel: Cache

Examples

Basic

Ctrl+K (Cmd+K on a Mac) or the button opens it. Typing filters by label and keywords, every word in any order: try "new inv". An item with href opens that page; one without is clicked, so give it wire:click or listen for the click, as the script beside this does.

Pages
Dashboard
Invoices
Customers
Settings
Actions
New invoice
Copy page link

Show code
Blade
<x-widget.command id="palette" label="Search pages and actions">
    <x-widget.command.group label="Pages">
        <x-widget.command.item href="#dashboard" icon="home" keywords="start overview">Dashboard</x-widget.command.item>
        <x-widget.command.item href="#invoices" icon="file" keywords="billing bills">Invoices</x-widget.command.item>
        <x-widget.command.item href="#customers" icon="users" keywords="clients people">Customers</x-widget.command.item>
        <x-widget.command.item href="#settings" icon="settings" keywords="account profile preferences" shortcut="G S">Settings</x-widget.command.item>
    </x-widget.command.group>
    <x-widget.command.group label="Actions">
        <x-widget.command.item icon="plus" keywords="create add" data-palette-action="New invoice">New invoice</x-widget.command.item>
        <x-widget.command.item icon="copy" keywords="share url" data-palette-action="Link copied">Copy page link</x-widget.command.item>
    </x-widget.command.group>
</x-widget.command>

<p id="palette-action" role="status" class="text-foreground/70 mt-3 text-sm"></p>
JavaScript, in your own JS file
// An item without href is clicked when chosen, by the pointer or Enter: here, it says what it did.
document.addEventListener('click', (event) => {
    const item = event.target.closest('[data-palette-action]');
    if (item) {
        document.getElementById('palette-action').textContent = item.dataset.paletteAction;
    }
});

Search your app

suggest-url asks your app as people type (GET ?q=…, JSON), with the same answer the search widget's suggestions take; its results follow the items that match. recent keeps the last five pages chosen, in this browser only, and lists them before anything is typed. trigger="false" leaves out the button: here a link opens it, with data-command-open.

Browse
New arrivals
On sale

, or press Ctrl+J.

Show code
Blade
<x-widget.command id="product-palette" label="Search products" placeholder="Search products…" :suggest-url="route('products.suggest')" :trigger="false" shortcut="j" recent>
    <x-widget.command.group label="Browse">
        <x-widget.command.item href="#new-arrivals" icon="star">New arrivals</x-widget.command.item>
        <x-widget.command.item href="#on-sale" icon="tag" keywords="discount offers">On sale</x-widget.command.item>
    </x-widget.command.group>
</x-widget.command>

<p class="text-sm">
    <button type="button" data-command-open="product-palette" class="text-link hover:text-link-hover underline underline-offset-4">Search products</button>, or press Ctrl+J.
</p>

Props

Other attributes, such as autocomplete or data-*, are passed through to the element. class styles the component's outer wrapper.

<x-widget.command>

Prop Default Description
id null The palette's id: anything with data-command-open="{id}" opens it, and so does command.open('{id}'). Made up when left out.
label 'Search' Its name for screen readers, and the trigger button's text.
placeholder 'Type a command or search…' The search box's placeholder.
shortcut 'k' The key that opens it with Ctrl (Cmd on a Mac): Ctrl+K by default. false for none.
trigger true A button that opens it, styled like a search box, with the shortcut on it. false to open it only by the shortcut or your own data-command-open element.
suggest-url null Your app's search, asked as people type (GET ?q=…, JSON): the same answer the search widget's suggest-url takes. Its results are listed after the items that match.
recent false Keeps the last few items chosen, in this browser only (localStorage), and shows them before anything is typed.
empty 'No results' What it says when nothing matches.

<x-widget.command.group>

Prop Default Description
label Required The heading over the group's items, which also names the group for screen readers.

<x-widget.command.item>

Prop Default Description
href null A page to open when it's chosen. Without one, choosing it clicks it: give it wire:click, or listen for the click.
icon null An icon before the label, by name, as the icon widget takes it.
keywords null More words it's found by, besides its label: "settings account profile".
shortcut null A key hint shown at the end of the row, such as "G D". Only shown: the palette doesn't bind it.
disabled false Shown greyed out, but it can't be chosen: the arrow keys pass it by, and Enter and a click do nothing.

Accessibility

All 2 examples above are checked with axe-core against the WCAG 2.2 A and AA rules, in the light theme and the dark one, both as the page draws and with each popover, dialog, toast and tooltip opened, on every change. A change that fails can't be merged. Where axe can't decide, such as contrast on SVG text, the test measures the colours itself instead of letting it pass.

Automated checks can't judge everything: how it sounds in a screen reader, and how it feels to use from the keyboard, still need a person. Check those on your own pages too.

Source

What bladewell:add command writes to your app with the default namespaces. Prefer to copy by hand? Take these files, plus the ones from the components it also adds , and the theme and base CSS.

resources/views/components/widget/command/group.blade.php Show
group.blade.php
resources/views/components/widget/command/index.blade.php Show
index.blade.php
resources/views/components/widget/command/item.blade.php Show
item.blade.php
resources/js/widget/command/index.js Show
index.js
app/View/Widget/ElementIds.php Show
ElementIds.php