Two plans, a monthly and yearly switch, and prices that roll to the new figure.
The prompt22,193 characters
Add the "Pricing" component from notboring to my project.
It is licensed for use in my projects — notboring.dev/license. Please:
1. Create the component at a sensible path for this
project, named Pricing, from the source below.
2. Install what it needs: npm i framer-motion
3. Add the CSS to the project's stylesheet.
4. THE PART THAT NEEDS YOUR JUDGMENT. The CSS reads
these custom properties and does not define them:
--card
--card-rgb
--font-ui
--ink
--ink-2
--ink-3
--ink-4
--ink-rgb
They are notboring's design tokens. Map each one to
whatever this project already uses for the same
job — its own ink, ground, surface and UI font —
rather than defining them as new globals. If the
project has no equivalent, define it locally on
the component's own root so nothing leaks out.
Anything ending -rgb wants three bare numbers,
because the CSS builds rgba() from it.
Keep the comments. They say why the numbers are what
they are, and they are most of what makes this worth
copying rather than rewriting.
--- Pricing.tsx ---
import { useEffect, useRef, useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
/* ══ Pricing ══════════════════════════════════════════════
Two plans, a switch between two ways of paying, and the
prices that answer it.
THE PRICES ROLL, AND ONLY THE PART THAT CHANGED. Flip to
yearly and $12 becomes $10: the dollar sign does not move,
the 1 does not move, and the 2 rolls down out of its line
box while a 0 rolls in from above. A price that fades and
fades back has told you there is a new number; one whose
changed digit visibly travels has told you which digit and
which way — down — which on a pricing page is the whole
message.
EACH DIGIT IS ITS OWN COLUMN. The figure is split into
characters and every one is a clipped cell holding the
character in it. A character that is the same before and
after keeps its key and is never asked to move; one that
differs is exited and entered by the presence around that
single cell, with the cell to its right starting 30ms
later, so the figure reads left to right as it changes.
Tabular figures make every cell the same width, so a
The rest — the source and its comments — is what you are buying.