Overview
TheActionColumn displays action buttons for each row in your table. It’s perfect for edit, delete, view, or any custom action buttons. Actions are automatically disabled for sorting and searching.
Creating an Action Column
Basic Usage
Factory Method
You can also create action columns using the baseColumn class:
With Custom Field Name
_actions_0, _actions_1).
Action-Specific Methods
Add an action button to the column. Each button displays for every row.Parameters:
label: The button textaction: Closure that returns a Livewire action string (receives$rowand$table)class: CSS classes for the button (default: empty string)icon: Optional icon HTML to display before the label (default: null)visible: Boolean or closure to conditionally show the button (default: true)
Common Methods
Set a custom label for the column header.Default:
'Actions'Completely customize the action cell rendering. This takes precedence over
button() definitions. The closure receives the row model and optionally the table component.Set the column width.
Apply CSS classes to both header and cells.
Apply CSS classes only to the column header.
Apply CSS classes only to the column cells.
Hide the column from display.
Conditionally hide the column.
Important Notes
- Sorting: Action columns cannot be made sortable (the
sortable()method is ignored) - Searching: Action columns cannot be made searchable with simple
searchable()(requires a closure) - Default Label: If not specified, the label defaults to “Actions”
- Visibility: Each button can have its own visibility condition
Examples
Basic Edit and Delete Actions
Actions with Icons
Conditional Button Visibility
Multiple Action Types
Actions with Confirmation
Custom Rendered Actions
Dropdown Menu Actions
Actions with Dynamic Classes
Icon-Only Actions
Default Rendering
When using thebutton() method, the column renders buttons automatically:
Public Getters
getActions(): array- Returns the array of all configured action buttons
Type
The column type identifier forActionColumn is 'action'.
Styling Action Buttons
The package provides default button classes that adapt to your theme:lt-btn-primary- Primary action button (blue/brand color)lt-btn-secondary- Secondary action button (gray)lt-btn-success- Success action button (green)lt-btn-warning- Warning action button (yellow/orange)lt-btn-danger- Danger action button (red)lt-btn-icon- Icon-only button (minimal styling)