Filter chips
Filter chips with counts above a list or table, for a single or multiple choice.
zb:chip-group zubazar/ui · free (MIT)
Single choice with counts
BLADE
Each chip can take ['label' => …, 'count' => …]; counts are written in the page's number format.
<zb:chip-group name="status" value="all" label="Order status" :options="[
'all' => ['label' => 'All', 'count' => 1480],
'pending' => ['label' => 'Pending', 'count' => 12],
'shipped' => ['label' => 'Shipped', 'count' => 35],
'delivered' => ['label' => 'Delivered', 'count' => 1433],
]" />
| Prop | Values |
|---|---|
options | value => text or [label, count] |
label | The group's name for screen readers |
Multiple choice
BLADE
multiple lets more than one chip be chosen; in a classic form the field is sent as tags[], in Livewire bind it to an array property.
<zb:chip-group name="tags" multiple :value="['new']" label="Tags" :options="['new' => 'New', 'sale' => 'On sale', 'stock' => 'In stock', 'express' => 'Express shipping']" />
| Prop | Values |
|---|---|
multiple | true | false |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
options | — | [] | value => text or ['label' => …, 'count' => …] |
name | — | null | The field name; without it, the wire:model / x-model name |
value | — | null | The chosen value(s) (without a binding) |
multiple | boolean | false | More than one chip (checkboxes) |
label | — | null | The group's name for screen readers |
Developer notes
- A single choice uses radio buttons and
multipleuses checkboxes; the form,wire:modeland the keyboard work as with any field.