Tuh-Doo: SVG Checkmark Animations & Task Completion Rewards in React
Using Vite, Redux, Framer Motion SVG pathLength animations, and per-item confetti rewards to turn a classic To-Do app into a front-end craft playground.
Almost every developer has built a To-Do list at some point. With Tuh-Doo (live at https://rniguel.github.io/tuh-doo/, code at https://github.com/rniguel/tuh-doo), I used that familiar scope to practice predictable Redux state paired with crisp completion micro-interactions.
Firing Confetti Only on Completion
Inside ToDoOption.tsx, each item registers its own reward ID (reward-${id}) and triggers confetti only when transitioning from incomplete to completed:
const { reward } = useReward(`reward-${id}`, "confetti");
const handleToggle = () => {
if (!completed) {
reward();
}
dispatch(toggleTodo(id));
};Animating the Checkmark with SVG pathLength
Instead of snapping an icon into place, Framer Motion animates pathLength from 0 to 1 on motion.path, drawing the checkmark stroke naturally in 250ms:
<motion.svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
<motion.path
d="M5 13l4 4L19 7"
strokeWidth={2.5}
strokeLinecap="round"
strokeLinejoin="round"
initial={{ pathLength: 0 }}
animate={{ pathLength: 1 }}
transition={{ duration: 0.25, ease: "easeOut" }}
/>
</motion.svg>Final Thoughts
Combining Redux state actions with small SVG motion details turns a routine checklist into something genuinely satisfying to click.
Miguel Riquelme
Front-end Engineer. Software Engineering MBA student at USP/Esalq.