Props
Mutable Props
Mutable properties can be updated at runtime using .updateProps().
Adaptive props
To apply different values by viewport or device, use Responsive with this component as the source. Props will update automatically when breakpoints change.
fps
- Type:
'auto' | number - Default:
'auto' - Frames per second (FPS) for the animation.
'auto'dynamically adapts to real device refresh rate (60Hz / 90Hz / 120Hz / 144Hz / 240Hz).- Throttling to a manual value (e.g.
30) reduces CPU/GPU load. - See demo
const raf = new Raf({
fps: 'auto',
});
// change value
raf.updateProps({
fps: 30,
});
enabled
- Type:
boolean - Default:
false - Enables or disables the Raf animation loop.
- See demo
const raf = new Raf({
enabled: false,
});
// change value
raf.updateProps({
enabled: true,
});