How useScramble works
mainThe useScramble hook provides a ref object that must be attached to a target DOM node (e.g., a <p> or <div>) for the text animation to take control of that element. By default, the animation starts automatically when the component mounts. You can customize the animation's pace, style, and character set via the configuration object.
import { useScramble } from 'use-scramble';
export const App = () => {
const { ref } = useScramble({
text: 'Achilles next, that nimble runner, swift on his feet as the wind',
speed: 0.6,
tick: 1,
step: 1,
scramble: 4,
seed: 0,
});
return <p ref={ref} />;
};