v0.0.2
Demos (demo panel, opens in a new tab)

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

Single choice with counts: view
BLADE

Each chip can take ['label' => …, 'count' => …]; counts are written in the page's number format.

blade
<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],
]" />
PropValues
optionsvalue => text or [label, count]
labelThe group's name for screen readers

Multiple choice

Multiple choice: view
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.

blade
<zb:chip-group name="tags" multiple :value="['new']" label="Tags" :options="['new' => 'New', 'sale' => 'On sale', 'stock' => 'In stock', 'express' => 'Express shipping']" />
PropValues
multipletrue | false

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
options—[]value => text or ['label' => …, 'count' => …]
name—nullThe field name; without it, the wire:model / x-model name
value—nullThe chosen value(s) (without a binding)
multiplebooleanfalseMore than one chip (checkboxes)
label—nullThe group's name for screen readers

Developer notes

Events, hooks and details
  • A single choice uses radio buttons and multiple uses checkboxes; the form, wire:model and the keyboard work as with any field.
Zubazar UI · ZubazarDesigned for people.