Playful Todolist
animate-ui/components-community-playful-todolistFreeComponent
A playful todolist component with animated wavy strikethroughs for each completed task.
Install it
npx shadcn@latest add https://animate-ui.com/r/components-community-playful-todolist.jsonSource
1'use client';23import * as React from 'react';4import { motion, type Transition } from 'motion/react';5import { Label } from '@/components/ui/label';6import { Checkbox } from '@/components/animate-ui/components/radix/checkbox';78const checkboxItems = [9 {10 id: 1,11 label: 'Code in Assembly 💾',12 defaultChecked: false,13 },14 {15 id: 2,16 label: 'Present a bug as a feature 🪲',17 defaultChecked: false,18 },19 {20 id: 3,21 label: 'Push to prod on a Friday 🚀',22 defaultChecked: false,23 },24];2526const getPathAnimate = (isChecked: boolean) => ({27 pathLength: isChecked ? 1 : 0,28 opacity: isChecked ? 1 : 0,29});3031const getPathTransition = (isChecked: boolean): Transition => ({32 pathLength: { duration: 1, ease: 'easeInOut' },33 opacity: {34 duration: 0.01,35 delay: isChecked ? 0 : 1,36 },37});3839function PlayfulTodolist() {40 const [checked, setChecked] = React.useState(41 checkboxItems.map((i) => !!i.defaultChecked),42 );4344 return (45 <div className="bg-neutral-100 dark:bg-neutral-900 rounded-2xl p-6 space-y-6">46 {checkboxItems.map((item, idx) => (47 <div key={item.id} className="space-y-6">48 <div className="flex items-center space-x-2">49 <Checkbox50 variant="accent"51 checked={checked[idx]}52 onCheckedChange={(val) => {53 const updated = [...checked];54 updated[idx] = val === true;55 setChecked(updated);56 }}57 id={`checkbox-${item.id}`}58 />59 <div className="relative inline-block">60 <Label htmlFor={`checkbox-${item.id}`}>{item.label}</Label>61 <motion.svg62 width="340"63 height="32"64 viewBox="0 0 340 32"65 className="absolute left-0 top-1/2 -translate-y-1/2 pointer-events-none z-20 w-full h-10"66 >67 <motion.path68 d="M 10 16.91 s 79.8 -11.36 98.1 -11.34 c 22.2 0.02 -47.82 14.25 -33.39 22.02 c 12.61 6.77 124.18 -27.98 133.31 -17.28 c 7.52 8.38 -26.8 20.02 4.61 22.05 c 24.55 1.93 113.37 -20.36 113.37 -20.36"69 vectorEffect="non-scaling-stroke"70 strokeWidth={2}71 strokeLinecap="round"72 strokeMiterlimit={10}73 fill="none"74 initial={false}75 animate={getPathAnimate(!!checked[idx])}76// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from Animate UI
All 580 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avatar Groupcomponents-animate-avatar-group | Animate UI | Components | Free | 1 dep | |
| Codecomponents-animate-code | Animate UI | Components | Free | 1 dep | |
| Code Tabscomponents-animate-code-tabs | Animate UI | Components | Free | 1 dep | |
| Cursorcomponents-animate-cursor | Animate UI | Components | Free | no deps | |
| GitHub Stars Wheelcomponents-animate-github-stars-wheel | Animate UI | Components | Free | 1 dep | |
| Tabscomponents-animate-tabs | Animate UI | Components | Free | no deps | |
| Tooltipcomponents-animate-tooltip | Animate UI | Components | Free | 1 dep | |
| Bubble Backgroundcomponents-backgrounds-bubble | Animate UI | Components | Free | 1 dep |
