spinner() html()
A loading indicator; with class_add htmx-indicator it shows while an htmx request runs.
html()->spinner($extra = [])Options
| Option | Meaning |
|---|---|
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. |
Example
Loading... Loading... Saving...
Code
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.
See also: html/placeholder, htmx/fragment