EN
Getting started
43 · Extended UI

Loading overlay

Covers an area with a semi-transparent layer while an operation runs and blocks clicks on it. It is bound to a Livewire action or an Alpine expression.

PRO acun:loading-overlay
01

With Alpine

show is an Alpine expression; the overlay is visible as long as it is true. The overlay covers the nearest relative container, so give the area to lock the relative class.

LIVE EXAMPLE
<div class="relative rounded-sm border border-gray-200 p-6 dark:border-zinc-700" x-data="{ locked: false }">
    <p class="text-sm text-gray-600 dark:text-zinc-400">This area is locked while the report is being prepared.</p>
    <acun:button class="mt-4" size="sm" x-on:click="locked = true; setTimeout(() => locked = false, 2000)">Prepare report</acun:button>
    <acun:loading-overlay show="locked" label="Preparing" />
</div>
PropValues
showAlpine expression
02

Label

label adds visible text next to the indicator and has screen readers read it too; without it, only the indicator is visible. In this example, the overlay is always on because neither show nor target is given.

LIVE EXAMPLE
<div class="grid gap-4 sm:grid-cols-2">
    <div class="relative h-32 rounded-sm border border-gray-200 p-4 dark:border-zinc-700">
        <p class="text-sm text-gray-600 dark:text-zinc-400">Customer list</p>
        <acun:loading-overlay />
    </div>
    <div class="relative h-32 rounded-sm border border-gray-200 p-4 dark:border-zinc-700">
        <p class="text-sm text-gray-600 dark:text-zinc-400">Sales report</p>
        <acun:loading-overlay label="Preparing the report" />
    </div>
</div>
PropValues
labelText next to the indicator
03

With Livewire

target takes the name of one Livewire action or property, or several separated by commas (wire:target). The overlay is visible only while these requests run.

BLADE
<div class="relative">
    <acun:table>…</acun:table>
    <acun:loading-overlay target="search,sort,gotoPage" />
</div>
PropValues
targetAction name | name1,name2
API

Props and slots

The values the component accepts.

PropDefaultDescription
targetnullLivewire action (wire:target); several separated by commas
shownullAlpine expression; visible while true
labelnullVisible text and screen reader label
Acun UI · Loading overlayDetailed usage and examples