Spinner
A small turning arc for work that runs right now, plus dots, ray and orbit styles; any size, speed and arc length, announced only when it has a label.
oxyn add spinnerLoading runs
Dioxus
rsx! {
Spinner {
size: 24.0,
label: "Loading runs",
}
}Rendered from Rust at build time · goes live when visible
When to use
- A small turning arc for work that runs right now, plus dots, ray and orbit styles; any size, speed and arc length, announced only when it has a label.
When not to use
- A small label for one control: use Tooltip instead.
- Actions and choices behind any trigger: use Dropdown Menu instead.
- The empty state of an AI app: use Starter prompts instead.
Installation
Spinner is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add spinnerRust
use crate::oxyn::{Spinner, PRIMITIVES_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{Spinner, PRIMITIVES_CSS};
Usage
Dioxus · rust
rsx! {
Spinner {
size: 24.0,
label: "Loading runs",
}
}Examples
Arc
A quarter arc.
Loading runs
Code
rsx! {
Spinner {
size: 24.0,
label: "Loading runs",
}
}Dots
Three dots.
Loading runs
Code
rsx! {
Spinner {
size: 24.0,
style: "dots",
label: "Loading runs",
}
}Ray
Eight rays.
Loading runs
Code
rsx! {
Spinner {
size: 24.0,
style: "ray",
label: "Loading runs",
}
}Orbit
A dot in orbit.
Loading runs
Code
rsx! {
Spinner {
size: 24.0,
style: "orbit",
label: "Loading runs",
}
}API reference
Spinner
| Prop | Type | Default | Description |
|---|---|---|---|
size | f32 | 14.0 | Size px (14). |
label | Option<String> | Default::default() | Spoken label. |
style | String | "arc" | `arc` · `dots` · `ray` · `orbit`. |
speed_ms | u32 | 750 | One turn, ms (750). |
arc | f32 | 0.25 | Arc length 0..1 (0.25). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| — | Not focusable |
Accessibility
- Silent without a label; with one it is a role=status that reads the label.
- Slows to one turn per 2.4 s under prefers-reduced-motion.
Responsive behaviour
- Any size from 10 px (inside a button) up.
Notes for AI
- Import
Spinnerfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
SpinnerElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.