SpringConfig
Tunes how a spring() animation moves: by its physics, or by a duration and how bouncy it is.
Usage
Fade a view on entry or removal.
This type is used by spring
// Fade a view on entry or removal.
import { Box, fade, slide, spring } from 'kuito';
<Box enter={fade.and(slide.up(12))} exit={fade} layout={spring()} />;Type declaration
export interface SpringConfig {
damping?: number;
stiffness?: number;
mass?: number;
velocity?: number;
/** False stops it at its target instead of swinging past; true by default. */
overshoot?: boolean;
energyThreshold?: number;
duration?: number;
dampingRatio?: number;
clamp?: { min?: number; max?: number };
delay?: number;
onEnd?: AnimationCallback;
}Members 11
| Name | Type | Required | Description |
|---|---|---|---|
damping | number | No | — |
stiffness | number | No | — |
mass | number | No | — |
velocity | number | No | — |
overshoot | boolean | No | False stops it at its target instead of swinging past; true by default. |
energyThreshold | number | No | — |
duration | number | No | — |
dampingRatio | number | No | — |
clamp | { min?: number; max?: number;} | No | — |
delay | number | No | — |
onEnd | AnimationCallback | No | — |
clamp — nested fields
clamp fields
| Name | Type | Required | Description |
|---|---|---|---|
min | number | No | — |
max | number | No | — |
onEnd — method signatures
Signatures
(finished: boolean): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
finished | boolean | Yes | — |
Returns
void
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.