Sticky actions
A bar that keeps the Save and Cancel buttons visible while a long form scrolls; it is built with Tailwind's sticky classes.
Form layout zubazar/ui-pro
This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →
Sticky bar at the top
BLADE
Give the bar sticky top-0 z-10; scroll the box in the example to try it.
<div class="max-h-96 overflow-y-auto rounded-sm bg-surface shadow-sm">
<div class="sticky top-0 z-10 flex items-center justify-between border-b border-line bg-surface/90 px-5 py-3 backdrop-blur">
<h3 class="text-sm font-semibold text-ink">General settings</h3>
<div class="flex gap-2"><zb:button size="sm" variant="white">Cancel</zb:button><zb:button size="sm">Save</zb:button></div>
</div>
<div class="space-y-4 p-5">
<zb:input name="store_name" label="Store name" />
<zb:textarea name="return_policy" label="Return policy" rows="12" />
</div>
</div>
| Prop | Values |
|---|---|
sticky top-0 z-10 | Pins the bar to the top of the container |
bg-surface/90 backdrop-blur | Blurs the content passing underneath |
Sticky bar at the bottom
BLADE
Put the bar at the end of the form with sticky bottom-0; the Save button stays at the bottom of the screen.
<div class="max-h-80 overflow-y-auto rounded-sm bg-surface shadow-sm">
<div class="grid gap-4 p-5 md:grid-cols-2">
@foreach (['Address title', 'Recipient name', 'Phone', 'District', 'Neighborhood', 'Street', 'Building no.', 'Apartment no.'] as $i => $label)
<zb:input name="bottom{{ $i }}" :label="$label" />
@endforeach
</div>
<div class="sticky bottom-0 flex justify-end gap-2 border-t border-line bg-surface/90 px-5 py-3 backdrop-blur">
<zb:button size="sm" variant="white">Cancel</zb:button>
<zb:button size="sm">Save</zb:button>
</div>
</div>
| Prop | Values |
|---|---|
sticky bottom-0 | Pins the bar to the bottom of the container |
On a panel page
BLADE
In the panel layout sticky top-0 sticks the bar right below the top bar; inside the form, Save works with type="submit".
<zb:form wire:submit="save" dirty-check>
<div class="sticky top-0 z-10 mb-6 flex items-center justify-between rounded-sm bg-surface/90 px-5 py-3 shadow-sm backdrop-blur">
<h1 class="text-base font-semibold text-ink">Company settings</h1>
<div class="flex gap-2">
<zb:button variant="white" :href="route('settings.index')">Cancel</zb:button>
<zb:button type="submit">Save</zb:button>
</div>
</div>
<zb:card>…</zb:card>
</zb:form>
| Prop | Values |
|---|---|
type="submit" | Submits the form while the bar is inside it |
Developer notes
z-10keeps the bar above the fields; the semi-transparent background (bg-surface/90) andbackdrop-blurkeep the content passing under it readable.