MCPcopy
hub / github.com/DavidHDev/react-bits / RotatingTextDemo

Function RotatingTextDemo

src/demo/TextAnimations/RotatingTextDemo.jsx:29–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27};
28
29const RotatingTextDemo = () => {
30 const { props, updateProp, resetProps, hasChanges } = useComponentProps(DEFAULT_PROPS);
31 const { rotationInterval, staggerDuration, staggerFrom, splitBy, auto, loop } = props;
32 const [key, forceRerender] = useForceRerender();
33
34 const propData = useMemo(
35 () => [
36 {
37 name: 'texts',
38 type: 'string[]',
39 default: '[]',
40 description: 'An array of text strings to be rotated.'
41 },
42 {
43 name: 'rotationInterval',
44 type: 'number',
45 default: '2000',
46 description: 'The interval (in milliseconds) between text rotations.'
47 },
48 {
49 name: 'initial',
50 type: 'object',
51 default: '{ y: "100%", opacity: 0 }',
52 description: 'Initial animation state for each element.'
53 },
54 {
55 name: 'animate',
56 type: 'object',
57 default: '{ y: 0, opacity: 1 }',
58 description: 'Animation state when elements enter.'
59 },
60 {
61 name: 'exit',
62 type: 'object',
63 default: '{ y: "-120%", opacity: 0 }',
64 description: 'Exit animation state for elements.'
65 },
66 {
67 name: 'animatePresenceMode',
68 type: 'string',
69 default: '"wait"',
70 description: "Mode for AnimatePresence; for example, 'wait' to finish exit animations before entering."
71 },
72 {
73 name: 'animatePresenceInitial',
74 type: 'boolean',
75 default: 'false',
76 description: 'Determines whether the AnimatePresence component should run its initial animation.'
77 },
78 {
79 name: 'staggerDuration',
80 type: 'number',
81 default: '0',
82 description: "Delay between each character's animation."
83 },
84 {
85 name: 'staggerFrom',
86 type: 'string',

Callers

nothing calls this directly

Calls 2

useComponentPropsFunction · 0.85
useForceRerenderFunction · 0.85

Tested by

no test coverage detected