Empty state
The box drawn in place of an empty list: an icon, a title, a short description and an action.
zb:shop.empty zubazar/ui-pro
This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →
Text only
In its simplest form, give only title and description; the icon and the action are optional.
<zb:shop.empty title="No orders yet" description="The orders you place are listed here." />
Empty cart
Write the icon into the icon slot and the button into the action slot; class turns the dashed border into a card surface.
<zb:shop.empty title="Your cart is empty" description="Add the products you like to your cart; you check out from here." class="bg-surface shadow-card border-0 py-16">
<zb:slot:icon>
<span class="flex size-16 items-center justify-center rounded-full bg-primary-tint text-primary-ink">
<zb:icon name="shopping-bag" size="8" />
</span>
</zb:slot:icon>
<zb:slot:action>
<zb:button :href="route('web.products.index')">Start shopping <zb:icon name="arrow-right" size="4" /></zb:button>
</zb:slot:action>
</zb:shop.empty>
No results
When the filters or the search find nothing, use the default look with a dashed border.
<zb:shop.empty title="We couldn't find what you're looking for" description="Try loosening the filters or searching with another word.">
<zb:slot:icon><zb:icon name="magnifying-glass" size="10" /></zb:slot:icon>
<zb:slot:action>
<zb:button variant="white" :href="route('web.products.index')">Clear filters</zb:button>
</zb:slot:action>
</zb:shop.empty>
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
title | — | — | The title; required |
description | — | null | A short description below the title |
Slots: icon: the icon or picture above the title; action: the button below the description. Both are optional.
Developer notes
- The store shows this box for an empty cart, on the checkout page and for a search with no results.
class="bg-surface shadow-card border-0"replaces the dashed border with the theme's card surface; the store's cart page draws it this way.