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

Pill action

A button with a colored round badge and a label that shows a few quick actions side by side, at equal width, on mobile.

zb:pill-action zubazar/ui-pro

PRO

This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →

Basic usage

Basic usage: view
BLADE

The badge content (an icon or a single character) comes from the slot, and the text below it from label.

blade
<div class="flex flex-wrap">
    <zb:pill-action label="Approve" variant="success"><zb:icon name="check" size="3.5" /></zb:pill-action>
    <zb:pill-action label="Hold" variant="warning"><zb:icon name="exclamation-triangle" size="3.5" /></zb:pill-action>
    <zb:pill-action label="Address"><zb:icon name="map-pin" size="3.5" /></zb:pill-action>
    <zb:pill-action label="Cancel" variant="danger"><zb:icon name="x-mark" size="3.5" /></zb:pill-action>
</div>
PropValues
labelText of the button

Colors

Colors: view
BLADE

Choose the badge color with variant (default info); match it to its meaning: success for positive, warning for a warning, danger for a rejection.

blade
<div class="flex flex-wrap">
    <zb:pill-action label="Success" variant="success">1</zb:pill-action>
    <zb:pill-action label="Warning" variant="warning">2</zb:pill-action>
    <zb:pill-action label="Danger" variant="danger">3</zb:pill-action>
    <zb:pill-action label="Info">4</zb:pill-action>
    <zb:pill-action label="Primary" variant="primary">5</zb:pill-action>
</div>
PropValues
variantprimary | secondary | success | danger | warning | info | dark

Emphasized and disabled

Emphasized and disabled: view
BLADE

emphasized highlights the recommended action with a solid green badge, and disabled makes the button faded and unclickable.

blade
<div class="flex flex-wrap">
    <zb:pill-action label="Approve" emphasized><zb:icon name="check" size="3.5" /></zb:pill-action>
    <zb:pill-action label="Hold" variant="warning"><zb:icon name="exclamation-triangle" size="3.5" /></zb:pill-action>
    <zb:pill-action label="Address" disabled><zb:icon name="map-pin" size="3.5" /></zb:pill-action>
</div>
PropValues
emphasizedtrue | false
disabledtrue | false

With Livewire

BLADE

By default the button renders type="button"; attributes such as wire:click go straight to the button.

blade
<div class="flex flex-wrap">
    <zb:pill-action label="Approve" emphasized wire:click="approve({{ $order->id }})">
        <zb:icon name="check" size="3.5" />
    </zb:pill-action>
    <zb:pill-action label="Hold" variant="warning" wire:click="hold({{ $order->id }})">
        <zb:icon name="exclamation-triangle" size="3.5" />
    </zb:pill-action>
</div>

Props

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

PropTypeDefaultDescription
label—nullText of the button
variant—infoprimary · secondary · success · danger · warning · info · dark (emerald, amber, red, blue also work)
emphasizedbooleanfalseSolid green badge and dark text (independent of variant)
disabledbooleanfalseFaded and unclickable

Slots: default (content of the badge: an icon or a single character)

Developer notes

Events, hooks and details
  • The buttons grow to share their row equally; place them side by side inside a flex container.
Zubazar UI · ZubazarDesigned for people.