EN
Getting started
55 · Extended UI

Pill action

An action button with a colored round badge and a label. It is used on mobile screens to offer a few quick actions side by side, at equal width.

PRO acun:pill-action
01

Basic usage

The content of the badge (an icon or a single character) comes from the slot, and the text below it from label. The buttons grow to share their row equally; place them side by side inside a flex container.

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

Colors

The badge color is chosen with variant: the same palette names as buttons, default info. Match colors to their meaning: success for a positive result, warning for a warning, danger for a rejection, info for information. The old names (emerald, amber, red, blue) also work.

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

Emphasized and disabled

emphasized makes the badge solid green and darkens the text; it highlights the recommended action in the row. The emphasis is always green, regardless of the variant value. disabled fades the button and makes it unclickable.

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

With Livewire

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

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

Props and slots

The values the component accepts.

PropDefaultDescription
labelnullText of the button
variantinfoprimary · secondary · success · danger · warning · info · dark (emerald, amber, red, blue also work)
emphasizedfalseSolid green badge and dark text (independent of variant)
disabledfalseFaded and unclickable
Slots: default (content of the badge: an icon or a single character)
Acun UI · Pill actionDetailed usage and examples