Spinner

ic.Spinner is an animated loading indicator you can drop into a figure to signal that something is in progress. It comes with nine distinct animation styles, from the classic spinning ring to a 3D rotating cube, and you control the size, speed, and color variant to match the context.

Animation kinds

Kind selects the animation style. Each one has a distinct visual character: ring and dual-ring are familiar rotational spinners, bars reproduces the iOS-style radial indicator, dots-wave and dots-line are more playful, pulse radiates outward, orbit tracks a dot along a circular path, grid pulses a 3x3 matrix, and cube renders a rotating 3D wireframe.

bars
dots-wave
dots-line
ring
pulse
orbit
grid
dual-ring
cube

Size and speed

Size scales the spinner proportionally (sm is 20px, md is 32px, lg is 48px), and Speed adjusts the animation tempo. Picking a slower speed can make the spinner feel less urgent, which suits background processes, while a faster speed works better for short, anticipated waits.

Controls

Variants

Variant maps the spinner color to the theme’s semantic tokens. primary is the default and works for general loading states. Use success, warning, or destructive to communicate the nature of the operation, for example a destructive spinner while a delete is in progress, or a success spinner during a final confirmation step.

primary
secondary
success
warning
destructive

Custom styling

Every component exposes a .css property for instance-level CSS overrides from MATLAB. All spinner kinds read from the --spinner-color CSS variable, so you can override just that to recolor any animation.

spn = ic.Spinner("Kind", "orbit", "Size", "lg");

spn.css.style(".ic-spinner", ...
    "background", "linear-gradient(135deg, #ede9fe, #fce7f3)", ...
    "border_radius", "50%", ...
    "padding", "8px", ...
    "box_shadow", "0 2px 10px rgba(139, 92, 246, 0.2)");

spn.css.style(".ic-spinner", ...
    "--spinner-color", "#8b5cf6");
Compatibility note. Figures run in different browsers depending on Matlabs version and operating system. CSS features like linear-gradient, backdrop-filter, or newer color functions may not work everywhere. For reference, MATLAB R2024b uses Chromium 104. Always test your custom styles in the MATLAB version you are targeting, and use canIuse to check compatibility of specific CSS features if you know the browser version MATLAB is using. Use the Developer Tools component to inspect the DOM structure of each component and find the right selectors for styling.