spinner() html()
A loading indicator; with class_add htmx-indicator it shows while an htmx request runs.
html()->spinner($extra = [])Опції
| Опція | Значення |
|---|---|
type | border (default) or grow. |
size, color, text | sm; a colour; screen reader text (default Loading...). |
class_add, id, style, no_escape, data-*, attr | Attributes. |
Приклад
Завантаження... Завантаження... Saving...
Код
return html()->spinner() . ' ' . html()->spinner(['type' => 'grow', 'color' => 'success'])
. ' ' . html()->spinner(['size' => 'sm', 'color' => 'danger', 'text' => 'Saving...']);Bootstrap 3 and 5
Bootstrap 5 spinner-border / spinner-grow; Bootstrap 3 and 4 a spinning Font Awesome icon.
Див. також: html/placeholder, htmx/fragment