Neura UI

Loading…

 Logo

Action button

One async commit on the button itself: idle, pending, then success.

Basic usage

The label morphs in place, the width springs to fit, and the trailing arrow leaves as a spinner, then a check. After success the button returns to idle on its own.
blade
<neura::action-button label="Save changes" method="save" />

<neura::action-button
    label="Publish"
    pending-label="Publishing"
    success-label="Published"
    method="publish"
    color="secondary"
/>

Livewire

method calls that public method and stays pending until the request finishes. wire:click="save" does the same when the value is a method name. reset-after="0" keeps the success state. A rejected action returns the button to idle.