Spinner
Loading indicator for pending UI states. Pure HTML/CSS, no JavaScript.
Usage
<hw:spinner />
The component renders an accessible SVG status indicator with data-slot="spinner", role="status" and
aria-label="Loading". When prefers-reduced-motion: reduce is active, the rotating animation becomes a slow opacity
pulse. Application CSS can disable that pulse by overriding animation on the slot.
Size
The selected preset matches the shadcn base-nova reference with a default size-4 spinner. The spinner inherits the current
text color, so it keeps contrast inside buttons, badges and other colored containers. Override the size or color with any
utility class:
<hw:spinner />
<hw:spinner class="size-6" />
<hw:spinner class="size-8 text-primary" />
In Buttons And Badges
Use data-icon when the spinner sits next to a label so button and badge spacing can adapt.
<hw:button disabled>
<hw:spinner data-icon="inline-start" />
Loading...
</hw:button>
<hw:badge>
<hw:spinner data-icon="inline-start" />
Syncing
</hw:badge>
Conditional Display
The spinner has no built-in visibility behavior — it always renders. Hide or show it with your own CSS, typically tied
to aria-busy on a parent element:
<button type="submit" aria-busy="false">
Save
<hw:spinner class="hidden aria-busy:block" />
</button>
Turbo automatically toggles aria-busy="true" on forms during submission, so the spinner appears while the request is
in flight and disappears when the response arrives.
Styling hooks
data-slot="spinner"data-icon="inline-start|inline-end"