Skip to content

Animator ​

<Animator name="t" min="0" max="6.28" step="0.05"> -- Wolfram's Animator: a <Slider> that plays. The play button and the readout are on by default and the sweep cycles unless told otherwise -- an animator's job is to run, not to stop at the end. Hold the button for the speed and loop.

Demos·packages/components/src/animator-box.ts· draws Animator

Props

PropTypeDefaultNotes
namestring""The binding this slider drives: name="a" fills the wildcard _a.reflects
valuestring"0"The starting value.
minnumberNumber.NaNLowest value. Defaults to a symmetric range around the start.
maxnumberNumber.NaNHighest value.
stepnumberNumber.NaNHow much one step moves the value; also fixes the printed places.
axis"x" | "y""x"x (default) lies flat; y stands the slider up.reflects
readoutbooleanfalseShow the value beside the track.reflects
playbooleanfalseShow a play/pause button. Space on the focused thumb toggles playback regardless.reflects
autoplaybooleanfalseSweep while scrolled into view; pause when scrolled out.
intervalnumberNumber.NaNMilliseconds per playback step. Defaults to a whole sweep in a few seconds.
ratenumberrate), interval: () => { if (Number.isFinite(this.interval) && this.interval > 0) return this.intervalPlayback speed as a multiplier on interval.reflects
loopLoop | ""loop), rate: () => (Number.isFinite(this.rate) && this.rate > 0 ? this.rate : 1), setRate: (rate) => (this.rate = rate), interval: () => { if (Number.isFinite(this.interval) && this.interval > 0) return this.intervalWhat an iteration does at the ends: cycle, reflect or none (default).reflects

As a web component

Plain custom elements, no framework required: import @enumeratio/frontend for the side effect and write <animator-box> in any HTML. Attributes are kebab-case and always strings; the props table above names each one's attribute where it differs from its prop.