steps
Builds the easing function of CSS steps(count, position): progress moves by jumps instead
of continuously, for frame-by-frame sprites, ticking counters, or a design tool’s “instant”
transition.
The input is clamped to [0, 1], like cubicBezier.
Available since v3.1.5
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
count | number | Number of steps, a positive integer (at least 2 with `‘jump-none’`) |
position | StepPosition | Where the jumps happen — see StepPosition. Defaults to `‘jump-end’`. |
Returns
Section titled “Returns”function — The easing function
Examples
Section titled “Examples”A four-frame sprite
Section titled “A four-frame sprite”Progress moves by jumps instead of continuously.
Jump at the start
Section titled “Jump at the start”With ‘jump-start’, the first jump happens right away.
Related Types
Section titled “Related Types”StepPosition
Section titled “StepPosition”Where the jumps of a steps easing happen, as in CSS steps():
'jump-end'(or'end', the default): the last jump at the end, so the first value lasts the first step;'jump-start'(or'start'): the first jump at the start;'jump-both': a jump at both ends, so neither0nor1is held;'jump-none': no jump at either end,0and1are held for a step each.
