Three steps in one card, and a line that fills as you go.
The prompt28,637 characters
Add the "Onboarding" 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 Onboarding, 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
--font-ui
--ink
--ink-3
--ink-4
--ink-5
--ink-rgb
--on-ink
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.
--- Onboarding.tsx ---
import { useEffect, useLayoutEffect, useRef, useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
/* ══ Onboarding ═══════════════════════════════════════════
Three steps in one card, and a line that fills as you go.
THE LINE IS THE PROGRESS, NOT THE NUMBERS. "Step 2 of 3" is
a fact; three segments with two of them full is the same
fact you can see from across the room — and the current
segment FILLING as you press Continue is the press being
answered, which a counter ticking from 2 to 3 is not. The
caption stays, small, for the person who wants the number.
ONE CARD, THREE HEIGHTS. The steps slide through the card
(the Login block's move) and the card's height is a tween
on the incoming step's measured height, so a short step
after a tall one is the card closing, not a gap. The block
reserves the tallest step and the card sits in the middle
of it.
Every step can be left: Back from the second, Skip on the
invitations, Escape anywhere. An onboarding you cannot get
out of is a form with a lock on it. */
The rest — the source and its comments — is what you are buying.