DecayConfig
Tunes how a decay() animation coasts to a stop from a velocity, and the range it stays within or rubber-bands past.
Utilização
Drag and release
Este tipo é usado por decay
import { Box, decay, motion, pan } from 'kuito';
export function Drawer() {
const drag = pan({ axis: 'y' }).release(decay({ clamp: [0, 400] }));
const y = motion(0).follows(drag.y);
return <Box gestures={[drag]} translateY={y} height={120} backgroundColor="#0f172a" />;
}Declaração do tipo
export interface DecayConfig {
/** Units per second; a gesture's release gives its own. */
velocity?: number;
deceleration?: number;
velocityFactor?: number;
clamp?: readonly [number, number];
/** Overshoot the clamp and spring back, instead of stopping at it. */
rubberBand?: boolean;
rubberBandFactor?: number;
delay?: number;
onEnd?: AnimationCallback;
}Membros 8
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
velocity | number | Não | Units per second; a gesture's release gives its own. |
deceleration | number | Não | — |
velocityFactor | number | Não | — |
clamp | readonly [number, number] | Não | — |
rubberBand | boolean | Não | Overshoot the clamp and spring back, instead of stopping at it. |
rubberBandFactor | number | Não | — |
delay | number | Não | — |
onEnd | AnimationCallback | Não | — |
onEnd — assinaturas de método
Assinaturas
(finished: boolean): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
finished | boolean | Sim | — |
Devolve
void
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.