UNPKG

react-textmotion

Version:

Lightweight yet powerful library that provides variable animation effects for React applications.

29 lines (28 loc) 754 B
import type { ElementType, ReactNode } from 'react'; import type { AnimationOrder, Motion, Preset, Split, Trigger } from './common'; export type BaseMotionProps = { as?: ElementType; split?: Split; trigger?: Trigger; repeat?: boolean; initialDelay?: number; animationOrder?: AnimationOrder; onAnimationStart?: () => void; onAnimationEnd?: () => void; }; export type MotionPresetProps = { motion: Motion; preset?: never; } | { motion?: never; preset: Preset[]; } | { motion?: undefined; preset?: undefined; }; export type TextMotionProps = BaseMotionProps & MotionPresetProps & { text: string; }; export type NodeMotionProps = BaseMotionProps & MotionPresetProps & { children: ReactNode; };