Spinner
An indicator that can be used to show a loading state.
Installation
Command to install the Spinner component.
Component Guide
Use the following to build the Spinner component.
from components.ui.spinner import spinnerSource Code & Dependencies
For manual installation, copy each of the source codes below in their respective locations.
components/core/core.py
components/ui/spinner.py
Examples
Size
Use a size-* utility class to change the spinner's size.
Props used: class_name on spinner.
Button
Add a spinner to a button for a loading state. Add data-icon="inline-start" to position it before the label.
Props used: data_icon on spinner.
Badge
Add a spinner to a badge for a loading/syncing state.
Props used: data_icon on spinner.
Marker
Combine spinner with marker and the shimmer utility for animated streaming status indicators. Set role="status" so assistive technology announces updates.
Props used: role on spinner.
API Reference
spinner
spinner(class_name="size-5")
Any other prop accepted by a native <svg> (role, aria_label, data_icon, etc.) is also passed straight through. role="status" is set by default.