A single value that updates a function when a new number is passed to set.

value(current <Number>, onUpdate <Function>)

value is a good way of managing multiple actions all trying to act on the same property. By passing an instance of value to another action’s output method (ie tween or physics), that action will register itself as the sole permitted updater of that value.

This means if a second action tries to update the value, the first action will be stopped first and there’ll be no conflicts.


  • set <Number>: Updates current and schedules an update. Returns the value passed to it, useful for functional composition.



import { value } from 'popmotion';
const ball = document.querySelector('.ball');
const ballRenderer = css(ball);

const ballX = value(
	(x) => ballRenderer.set('x', x)


tween({ from: ballX.get(), to: 300 })