Skip to content

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 spinner
MCP
Loading 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 spinner
Rust
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

PropTypeDefaultDescription
sizef3214.0Size px (14).
labelOption<String>Default::default()Spoken label.
styleString"arc"`arc` · `dots` · `ray` · `orbit`.
speed_msu32750One turn, ms (750).
arcf320.25Arc length 0..1 (0.25).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
—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 Spinner from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: SpinnerEl in oxyn_gpui.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI