Tiles
Activity
659 commits in 16 weeks
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardTiles(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/card-tilesAbout this component
An activity card: sixteen weeks as a grid of small tiles in an indigo ramp with coral for the busiest days. Hover or press it and the grid tips into a skyline, every day rising into a column as tall as its count, and the header names the day under the pointer.
Triggers
- Hover
- Click
- State change
- 3D
- Mouse tracking
- Card
- Delay stagger
Techniques
- requestAnimationFrame
- 3D transform
- Event position
- Stagger
- Interval
- State machine
Difficulty
Advanced
Accessibility
Keyboard and screen readers
The grid is a native <button> with aria-pressed and a label that gives the total ("… commits in the last 16 weeks. Show as a skyline"), with a :focus-visible ring; Enter or Space pins the skyline. Single days are a pointer extra, so the tiles are aria-hidden and the total is always in the text.
Reduced motion
There is no wave and the skyline appears and leaves at once.
Use it in anything you build, commercial and client work included. Licence