Data
JS behaviour
Status badge
A live status pill that follows its data-status: on a Livewire re-render (or your own x-bind) the width settles with the label and the icon swaps.
Real scenarios
The component as it is used in a product — not a specimen grid.
The nightly jobs, named in your words
Five states, one pill each — the labels map swaps the built-in words for yours, and every pill’s width settles with its own label.
- Ingest today’s tickets Queued
- Re-embed the knowledge base Running
- Nightly database backup Succeeded
- Exchange rates refresh Failed
- Stale-report cleanup Canceled
A deployment, as it happens
live gives the pill role="status" so each change is spoken; the buttons flip a Livewire property and the morphing badge follows it — no page turn, the pill simply reshapes.
Release v2.5.0
Queued
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| status | string | queued | running | success | failed | queued | canceled. |
| live | bool | false | Announces changes (role="status") — for states that update on their own. |
| label / labels | string / array | null / [] | A single label, or a labels map that overrides the built-in words. |
| size | string | null | The pill size (lg, for instance). |
Snippet
<x-nx::status-badge :status="$job->status" live />
<x-nx::status-badge status="queued" x-bind:data-status="s" />