Skip to content
jolt.
← Recipes

MOTION / iOS / NATIVESCRIPT VUE

Follow the feeling.

A chain of springs that stays connected to your input.

Native recording · iOSiOS 26 simulator · native playback with actual XCTest input, original speed. Not a physical-device performance measurement.

The motion behind it.

Jolt 0.1.0-rc.11

The core API example, taken directly from the guide. Use the full demo for the surrounding interface and controls.

TypeScript · NativeScript
import { bind, motionScope, motionValue, set, springValue } from '@rafaelaugusto/jolt'

const scope = motionScope()
const pointer = motionValue(0)
const first = scope.add(springValue(pointer, { stiffness: 260, damping: 24 }))
const second = scope.add(springValue(first, { stiffness: 260, damping: 24 }))
scope.use(() => bind(cursor, { x: first }))
scope.use(() => bind(trailingCursor, { x: second }))

set(pointer, 180)
set(pointer, -40) // preserves each follower's position and velocity
// On page/component disposal:
scope.dispose()
View full demo ↗

Read the full guide ↗