Spinner
A spinning loading indicator with role="status" and an accessible label.
Installation
Shadwire follows shadcn/ui's open code model: the component's source is copied into your application and becomes yours. Install it with the CLI:
The spinner registry item installs these files:
-
app/components/ui_component.rb -
app/components/ui/spinner_component.rb -
app/helpers/ui/spinner_helper.rb -
vendor/shadwire/shadwire.css
Haven't installed the CLI yet? gem install shadwire, then shadwire init.
Usage
Examples
Default
Standalone (it announces "Loading") and composed inside a button (decorative).
API reference
Every part accepts class / class_name and **attrs.
| Component | Argument | Default | Description |
|---|---|---|---|
Spinner |
label |
"Loading" |
The name role="status" announces. Pass nil beside visible text to make the spinner decorative. |