# Remotion API & Patterns
Detailed cookbook for building and rendering Remotion compositions.
## interpolate: full options
```jsx
import {interpolate, Easing} from 'remotion';
interpolate(frame, [0, 30, 60], [0, 100, 0], {
easing: Easing.bezier(0.25, 0.1, 0.25, 1), // CSS ease equivalent
extrapolateLeft: 'clamp', // 'extend' (default) | 'clamp' | 'identity' | 'wrap'
extrapolateRight: 'clamp',
});
```
- Input ranges must be strictly monotonically increasing.
- Multi-stop ranges (`[0,30,60]`) create keyframe chains.
- `extrapolate: 'extend'` (default) continues the linear slope past the range — almost always clamp instead.
- `extrapolate: 'wrap'` repeats the range — handy for loops.
Common easings: `Easing.linear`, `Easing.ease`, `Easing.in(Easing.quad)`, `Easing.out(Easing.cubic)`, `Easing.inOut(Easing.ease)`, `Easing.elastic(1)`, `Easing.bezier(x1,y1,x2,y2)`.
## spring: config recipes
```jsx
spring({frame, fps, config, durationInFrames, delay, from, to});
```
| Feel | config |
|---|---|
| Smooth, no overshoot | `{damping: 200}` |
| Gentle bounce | `{damping: 12, stiffness: 100, mass: 1}` |
| Snappy UI pop | `{damping: 20, stiffness: 200, mass: 0.6}` |
| Heavy / slow | `{mass: 3, damping: 40, stiffness: 80}` |
- `from`/`to` remap the 0→1 output to any range without an extra `interpolate`.
- `durationInFrames` time-stretches the spring to fit a fixed window.
- `delay` postpones the start (in frames).
- `measureSpring({fps, config})` returns how many frames the spring needs to settle — use it to size sequences.
```jsx
// Spring from 100px down to 0, settling in 40 frames, starting at frame 10
const y = spring({frame, fps, from: 100, to: 0, durationInFrames: 40, delay: 10});
```
## Sequence & Series scheduling
```jsx
```
- `from` offsets local time; inside, `useCurrentFrame()` returns `globalFrame - from`.
- `durationInFrames` clips visibility; omit for infinite.
- `layout="none"` removes the default absolute-fill wrapper (use when the child manages its own layout, e.g. inline text).
- `name` labels the sequence in the Studio timeline.
Crossfade between two Series segments by overlapping with negative `offset` and fading:
```jsx
```
## Audio + beat sync
```jsx
import {Audio, staticFile} from 'remotion';