State can change
Import the full entry or framework adapter. Set any of the 70 states.
Documentation
Pick the import that matches your UI, then use the same small set of controls everywhere.
Install
npm install loaderszCustom element
Import the package once to register the element. Use a meaningful label whenever the loader conveys status.
import 'loadersz';
<loadersz-loader
state="solving"
size="96"
speed="1.1"
aria-label="Solving"
></loadersz-loader>Framework guide
Use the full import when the animation can change at runtime. Use a direct import when it is fixed: that ships one movement and the canvas core.
Import the full entry or framework adapter. Set any of the 70 states.
Import one state such as loadersz/racing. Smaller bundle, same element.
Use the full library when the state can change while the app runs.
import 'loadersz';
<loadersz-loader state="racing" size="96" aria-label="Loading"></loadersz-loader>Smaller application bundles
A direct state entry includes the Canvas core and exactly one animation. It needs no bundler configuration and registers the same native element.
import 'loadersz/racing';
<loadersz-loader
state="racing"
size="96"
aria-label="Loading"
></loadersz-loader>Use loadersz/racing, loadersz/solving, or any of the 70 state names. Each fixed entry currently ships at roughly 2.5–3.1 kB gzipped. Use loadersz when you need to switch states at runtime.
For an owned canvas, import LoaderszLoader from the same direct entry. loadersz/modes remains available for named factories in ESM-aware builds.
A direct import fixes the drawing code, not the markup. Keep the matching state value in your markup for clarity, but changing it later does not load another animation.
Prop names
The native element uses browser attribute names. React and Vue wrappers use camelCase only for the two multi-word props; every other control keeps its name.
aria-labelariaLabelAccessible labelforce-motionforceMotionIgnore reduced motionsize, speed, density, hue, color, themesame namesVisual controlspausedpausedFreeze the current frameAttributes
stateworkingThe semantic movement to show.
size96Square canvas size in CSS pixels.
speed1Animation timeline multiplier.
density1Geometry detail from 0.35 to 2.
hue-A hue from 0 to 360. Omit it for the native palette.
color-A hex, CSS colour, or inherited CSS variable. Overrides hue.
themeautoauto, dark, or light.
pausedfalseStops on the current frame when present.
force-motionfalseKeeps animating when reduced motion is enabled.
Leave both hue and color off to preserve the motion’s own palette. That includes multicolour treatments and deliberately monochrome loaders. Add hue for one unified hue or color for one exact CSS colour.
<!-- Native: preserves the motion's own palette -->
<loadersz-loader state="racing" size="96" />
<!-- Hue: one unified colour -->
<loadersz-loader state="racing" size="96" hue="278" />
<!-- CSS: one exact colour or a CSS token -->
<loadersz-loader state="racing" size="96" color="var(--brand)" />