Snackbar
Live Demos HubSnackbar
Interactive production-grade hypermedia component for HTMXUI.
Interactive Preview
HTML Source
<!--
Component: snackbar.html
Configurable State: themeColor ('primary'|'secondary'|'destructive'), size ('sm'|'md'|'lg'), isOpen (boolean)
Usage: Bind styles dynamically using hx-class="{ 'bg-primary': themeColor === 'primary' }" or hx-style="{ width: size === 'lg' ? '100%' : 'auto' }"
-->
<div hx-ext="reactive" hx-state="{ themeColor: \'primary\', size: \'md\', isOpen: false }" class="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between gap-4 rounded-md bg-foreground px-4 py-3 text-background shadow-lg animate-in fade-in slide-in-from-bottom-5">
<p class="text-sm">{message}</p>
<button hx-on:click="this.parentElement.remove()" class="text-sm font-medium hover:underline text-primary-foreground">Close</button>
</div>