# keyframes

`keyframes(options)` creates an immutable seekable definition from at least two
values. Optional offsets must be nondecreasing and cover the values; easing may
be one function or one per segment. Numbers interpolate by default, while other
types require a [`PibblInterpolator`](/reference/types/canvas-runtime/#pibblinterpolator).

Related types: [`PibblAnimationDefinition`](/reference/types/canvas-runtime/#pibblanimationdefinition)
and [`PibblKeyframesOptions`](/reference/types/canvas-runtime/#pibblkeyframesoptions).

## API details from source

<span id="api-keyframes"></span>

Returns an opaque immutable keyframe definition.

```ts
keyframes: <T>(options: Readonly<PibblKeyframesOptions<T>>) => PibblAnimationDefinition<T>
```

Related API: [keyframes](/reference/functions/keyframes/), [PibblKeyframesOptions](/reference/types/canvas-runtime/#pibblkeyframesoptions), [PibblAnimationDefinition](/reference/types/canvas-runtime/#pibblanimationdefinition).

### Parameters

- **`options`** — Keyframe values, timing, easing, and interpolation settings. See
[PibblKeyframesOptions](/reference/types/canvas-runtime/#pibblkeyframesoptions) .

### Returns

An immutable animation definition sampling the keyframes. See
[PibblAnimationDefinition](/reference/types/canvas-runtime/#pibblanimationdefinition) .

### See also

[PibblKeyframesOptions](/reference/types/canvas-runtime/#pibblkeyframesoptions)

[PibblAnimationDefinition](/reference/types/canvas-runtime/#pibblanimationdefinition)

[View source — packages/core/src/lib/animation/definition.ts:589](/source/packages/core/src/lib/animation/definition-ts/#L589)

## Implementation guidance for agents

Read the [Animation and scheduling companion](/agents/topics/animation/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Compose keyframes and springs](/minimal-examples/animation/composition/): Run two independent tracks together, then mark, wait, and repeat. [Plain source](/minimal/animation/composition.tsx)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
