List group
Shows a bordered list with rows separated by lines; rows can be text, links, active or disabled.
zb:list-group zubazar/ui · free (MIT)
Basic usage
BLADE
zb:list-group is a list and each zb:list-group.item is a row; a row without href is plain text.
<zb:list-group>
<zb:list-group.item>Istanbul Main Warehouse</zb:list-group.item>
<zb:list-group.item>Ankara Warehouse</zb:list-group.item>
<zb:list-group.item>Izmir Warehouse</zb:list-group.item>
</zb:list-group>
Links and states
BLADE
href makes the row a link, active highlights the selected row and disabled fades the row.
<zb:list-group>
<zb:list-group.item href="#" active>Istanbul Main Warehouse</zb:list-group.item>
<zb:list-group.item href="#">Ankara Warehouse</zb:list-group.item>
<zb:list-group.item href="#">Izmir Warehouse</zb:list-group.item>
<zb:list-group.item href="#" disabled>Bursa Warehouse (inactive)</zb:list-group.item>
</zb:list-group>
| Prop | Values |
|---|---|
href | Link address |
active | true | false |
disabled | true | false |
Icon and badge
BLADE
Put the icon at the start of the row and push the badge to the end with the ms-auto class.
<zb:list-group>
<zb:list-group.item href="#" active><zb:icon name="building-storefront" size="4" /> Istanbul Main Warehouse <zb:badge class="ms-auto">312</zb:badge></zb:list-group.item>
<zb:list-group.item href="#"><zb:icon name="building-storefront" size="4" /> Ankara Warehouse <zb:badge class="ms-auto">148</zb:badge></zb:list-group.item>
<zb:list-group.item href="#"><zb:icon name="building-storefront" size="4" /> Izmir Warehouse <zb:badge class="ms-auto">205</zb:badge></zb:list-group.item>
<zb:list-group.item disabled><zb:icon name="building-storefront" size="4" /> Bursa Warehouse (inactive)</zb:list-group.item>
</zb:list-group>
Flush
BLADE
flush removes the outer border and background; inside a card, use it together with :padding="false".
<zb:card title="Pending orders" :padding="false">
<zb:list-group flush>
<zb:list-group.item>Ayşe Yılmaz <zb:badge variant="warning" class="ms-auto">Awaiting payment</zb:badge></zb:list-group.item>
<zb:list-group.item>Mehmet Kaya <zb:badge variant="warning" class="ms-auto">Awaiting payment</zb:badge></zb:list-group.item>
<zb:list-group.item>Zeynep Arslan <zb:badge class="ms-auto">Preparing</zb:badge></zb:list-group.item>
</zb:list-group>
</zb:card>
| Prop | Values |
|---|---|
flush | true | false |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
flush | boolean | false | Without the outer border and background |
list-group.item: href | — | null | Makes the row a link |
list-group.item: active | boolean | false | Selected row; aria-current is added to the link |
list-group.item: disabled | boolean | false | Faded row; no link is produced |