CoolCheckbox

CoolCheckbox bestows animated tick-wisdom upon thy todo list! With a dash of motion-react magic and a daddy wink, each completed task doth shimmy and fade like yon summer breeze toggle on and prospereth in style, I prithee!




Installation



Understanding the Component

List Rendering & Interaction

Renders interactive list items and handles state toggling with proper accessibility attributes.

  • Uses onToggle callback to update checked state
  • Applies role="checkbox" and aria-checked for screen readers

Checkbox Icon Animation

Smoothly animates SVG paths based on checked state using scale, opacity, and clipPath transitions.

  • Fills and scales circle on check
  • Reveals checkmark path via clipPath
  • Fades outer stroke when toggled

Text Strike-through & Movement

Animates title text sliding and strikethrough overlay to visually indicate checked status.

  • Shifts text horizontally with keyframes
  • Adjusts text opacity when checked
  • Expands strikethrough line via an absolute positioned motion.span

Props

PropTypeDefaultDescription
todosTodo[]noneArray of todo items to render, each with id, title, and checked fields.
onToggle(id: number) => voidnoneCallback invoked when a todo is clicked; receives the todo’s id.