Smart breadcrumbs with contextual actions for Laravel applications.
Transform cluttered admin toolbars into elegant, contextual navigation:
Dashboard > Users ⌄ > John Doe ⌄
↓ ↓
[Export] [Edit]
[Import] [Delete]
composer require hdaklue/actioncrumbRequirements: PHP 8.2+, Laravel 11+, Livewire 3+, Filament Actions 4+, Tailwind CSS, Alpine.js
<?php
namespace App\Livewire\Admin;
use Hdaklue\Actioncrumb\Components\WireCrumb;
use Hdaklue\Actioncrumb\{Step, Action};
class UsersManagement extends WireCrumb
{
protected function actioncrumbs(): array
{
return [
Step::make('Dashboard')
->icon('heroicon-o-home')
->url('/dashboard'),
Step::make('Users')
->icon('heroicon-o-users')
->current()
->actions([
Action::make('Export')
->icon('heroicon-o-arrow-down-tray')
->execute(fn() => $this->exportUsers()),
Action::make('Import')
->icon('heroicon-o-arrow-up-tray')
->route('users.import'),
])
];
}
public function exportUsers()
{
// Your logic here
$this->dispatch('notify', 'Users exported!');
}
}<div>
{!! $this->renderActioncrumbs() !!}
<!-- Your page content -->
</div>Add to your resources/css/app.css (Tailwind 4):
@import "../../../../vendor/hdaklue/actioncrumb/resources/css/actioncrumb.css";Add to your layout:
<!-- Tailwind CSS (required) -->
@vite(['resources/css/app.css'])
<!-- Alpine.js (required for dropdowns) -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>Step::make('Users')
->icon('heroicon-o-users')
->route('users.index')
->actions([
Action::make('Export')->execute(fn() => $this->export()),
Action::make('Settings')->url('/settings'),
])Step::make('Current Page')->current(true)Step::make('User')
->actions([
Action::make('Edit')
->visible(fn() => auth()->user()->can('edit-users'))
->execute(fn() => $this->editUser()),
])// Execute callback
Action::make('Delete')->execute(fn() => $this->delete())
// Navigate to URL
Action::make('Settings')->url('/admin/settings')
// Navigate to route
Action::make('Users')->route('users.index', ['type' => 'active'])
// Using WireAction with Filament actions (recommended)
$wireAction = WireAction::make('test')->livewire($this);
$action = $wireAction->execute('testAction'); // Triggers mountAction('testAction')
// Use $action in Step.actions() arrayBreadcrumb Navigation Components - Use WireCrumb base class:
use Hdaklue\Actioncrumb\Components\WireCrumb;
class UserManagement extends WireCrumb
{
protected function actioncrumbs(): array
{
return [
Step::make('Dashboard')->url('/dashboard'),
Step::make('Users')->current(),
];
}
}Individual Components - Use HasActionCrumbs trait:
use Hdaklue\Actioncrumb\Traits\HasActionCrumbs;
class UserComponent extends Component
{
use HasActionCrumbs;
protected function actioncrumbs(): array
{
return [
Action::make('Edit')->execute(fn() => $this->edit()),
Action::make('Delete')->execute(fn() => $this->delete()),
];
}
}Using WireAction for executing Filament Actions:
use Filament\Actions\Action as FilamentAction;
use Hdaklue\Actioncrumb\Action;
class UserWireStep extends Component implements HasActions
{
use HasActionCrumbs;
use InteractsWithActions;
public function editAction(): FilamentAction
{
return FilamentAction::make('edit')
->form([
TextInput::make('name')->required(),
TextInput::make('email')->email(),
])
->action(function (array $data) {
$this->user->update($data);
});
}
// Option 1: Direct Action objects with mountAction
protected function actioncrumbs(): array
{
return [
Action::make('Edit')
->icon('heroicon-o-pencil')
->execute(fn() => $this->mountAction('edit')),
Action::make('Delete')
->icon('heroicon-o-trash')
->execute(fn() => $this->mountAction('delete')),
];
}
// Option 2: Using WireAction for Filament integration
protected function actioncrumbsWithWireAction(): array
{
$wireAction = WireAction::make('user-actions')->livewire($this);
return [
$wireAction->execute('edit'), // Calls mountAction('edit')
$wireAction->execute('delete'), // Calls mountAction('delete')
];
}
}ActionCrumb provides a fluent configuration API to customize appearance and behavior globally.
Configure ActionCrumb in your AppServiceProvider:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Hdaklue\Actioncrumb\Configuration\ActioncrumbConfig;
use Hdaklue\Actioncrumb\Enums\{ThemeStyle, SeparatorType, TailwindColor};
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
ActioncrumbConfig::make()
->themeStyle(ThemeStyle::Rounded) // Simple, Rounded, Square
->separatorType(SeparatorType::Chevron) // Chevron, Line, Backslash
->primaryColor(TailwindColor::Blue) // Any Tailwind color
->secondaryColor(TailwindColor::Gray) // Secondary accents
->background(true) // Enable/disable subtle backgrounds (default: true)
->enableDropdowns(true) // Enable/disable dropdowns
->compact(false) // Compact spacing
->compactMenuOnMobile(true) // Mobile-specific behavior
->bind();
}
}Simple - Clean, minimal design:
ActioncrumbConfig::make()->themeStyle(ThemeStyle::Simple)Rounded - Modern pill design:
ActioncrumbConfig::make()->themeStyle(ThemeStyle::Rounded)Square - Bold geometric design:
ActioncrumbConfig::make()->themeStyle(ThemeStyle::Square)All Tailwind colors are supported:
// Primary colors (current step, active states)
->primaryColor(TailwindColor::Blue)
->primaryColor(TailwindColor::Purple)
->primaryColor(TailwindColor::Green)
// Secondary colors (other steps, borders)
->secondaryColor(TailwindColor::Gray)
->secondaryColor(TailwindColor::Slate)
->secondaryColor(TailwindColor::Zinc)Choose between different separator styles:
// Chevron arrows (default)
->separatorType(SeparatorType::Chevron)
// Vertical lines
->separatorType(SeparatorType::Line)
// Forward slash
->separatorType(SeparatorType::Backslash)Control breadcrumb item backgrounds (enabled by default):
// Enable subtle backgrounds for breadcrumb items (default)
->background(true)
// Disable backgrounds for a minimal, text-only appearance
->background(false)When enabled, breadcrumb items display subtle background colors based on the configured primaryColor and secondaryColor, creating a more defined breadcrumb appearance. When disabled, only text colors are applied for a cleaner, minimal look.
Control mobile behavior:
// Show full breadcrumb with horizontal scroll on mobile
->compactMenuOnMobile(false)
// Show compact menu with hamburger on mobile
->compactMenuOnMobile(true)ActioncrumbConfig::make()
->themeStyle(ThemeStyle::Rounded)
->separatorType(SeparatorType::Chevron)
->primaryColor(TailwindColor::Purple)
->secondaryColor(TailwindColor::Slate)
->enableDropdowns(true)
->compact(false)
->compactMenuOnMobile(true)
->bind();Publish views for customization:
php artisan vendor:publish --tag=actioncrumb-viewsAdd to your tailwind.config.js:
module.exports = {
content: [
'./vendor/hdaklue/actioncrumb/resources/views/**/*.blade.php',
],
// ...
}class UserManagement extends WireCrumb
{
protected function actioncrumbs(): array
{
return [
Step::make('Dashboard')->url('/dashboard'),
Step::make('Users')->route('users.index')->actions([
Action::make('Create User')->route('users.create'),
Action::make('Export')->execute(fn() => $this->export()),
]),
Step::make($this->user->name)->current(true),
];
}
}class UserStepComponent extends Component
{
use HasActionCrumbs;
protected function actioncrumbs(): array
{
return [
Action::make('Edit')
->visible(fn() => auth()->user()->can('edit-users'))
->execute(fn() => $this->edit()),
Action::make('Delete')
->visible(fn() => auth()->user()->can('delete-users'))
->execute(fn() => $this->delete()),
];
}
}Icons not showing?
composer require blade-ui-kit/blade-heroiconsDropdowns not working? Make sure Alpine.js is loaded:
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>Styling issues? Ensure Tailwind processes the package views:
// tailwind.config.js
content: [
'./vendor/hdaklue/actioncrumb/resources/views/**/*.blade.php',
]The MIT License (MIT). See License File for more information.