Dive
Content that expands. Goes in head first and comes up.
Full time
North 2–1 South
Possession58%
Shots on target7
Passes412
Distance108 km
- Sport
- Swimming
- Move
- Goes in head first and comes up.
- For
- Content that expands
sinks past, comes up 560ms · 60ms apart · reduced: fade
01 Install
npx shadcn@latest add https://moveui-red.vercel.app/r/dive.jsonIt brings the tokens with it. The first time, import the tokens once in your root layout:
import "@/components/moveui/tokens.css";Not using shadcn? Copy the files below into components/moveui/, and tokens.css next to them.
02 Use it
import "@/components/moveui/dive/dive.css";
<div className="ml-dive" data-open={open ? "" : undefined}>
<div className="ml-dive__pool">
{rows.map((row, i) => (
<p key={row} style={{ "--i": i } as React.CSSProperties}>{row}</p>
))}
</div>
</div>03 Or ask your agent
Paste this into Claude Code, Cursor or any coding agent. It installs the piece and wires it in.
Add the Move UI "Dive" piece to this project. It's for: Content that expands.
1. Install it: npx shadcn@latest add https://moveui-red.vercel.app/r/dive.json
2. If the project doesn't import the Move UI tokens yet, add this once to the root layout: import "@/components/moveui/tokens.css";
3. Use it like this, adapted to where it belongs in my code:
import "@/components/moveui/dive/dive.css";
<div className="ml-dive" data-open={open ? "" : undefined}>
<div className="ml-dive__pool">
{rows.map((row, i) => (
<p key={row} style={{ "--i": i } as React.CSSProperties}>{row}</p>
))}
</div>
</div>
Keep its reduced-motion behaviour and keyboard support. Don't hardcode durations, easing or colours: they come from the --ml-* tokens.
Docs: https://moveui-red.vercel.app/pieces/diveWant your agent to know the whole library and its motion rules? Add the Move UI skill to your project:
npx shadcn@latest add https://moveui-red.vercel.app/r/skill.json04 Code
/*
Dive (swimming): goes in head first and comes up. For content that expands.
Markup: .ml-dive > .ml-dive__pool > children (give each child --i for the stagger).
Set [data-open] on .ml-dive: the pool opens (--ml-dur-travel), each child enters from above, sinks a
little past its place and comes back up to rest. Closing is quick and flat (--ml-dur-exit).
Reduced motion: opens without the dive, children fade.
*/
.ml-dive {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows var(--ml-dur-exit) var(--ml-ease-out);
}
.ml-dive[data-open] { grid-template-rows: 1fr; transition-duration: var(--ml-dur-travel); }
.ml-dive__pool { min-height: 0; overflow: hidden; }
.ml-dive__pool > * { opacity: 0; transition: opacity var(--ml-dur-exit) var(--ml-ease-out); }
.ml-dive[data-open] .ml-dive__pool > * {
opacity: 1;
animation: ml-dive-in var(--ml-dur-travel) both;
animation-delay: calc(var(--i, 0) * var(--ml-stagger) * 2);
}
@keyframes ml-dive-in {
/* head first, from above the surface */
0% { opacity: 0; transform: translateY(-16px) scaleY(1.04); transform-origin: 50% 0; animation-timing-function: cubic-bezier(0.45, 0, 0.8, 0.5); }
/* under: a little past its place */
48% { opacity: 1; transform: translateY(5px) scaleY(0.98); animation-timing-function: var(--ml-ease-out); }
/* and up for air */
100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
@keyframes ml-dive-in { from { opacity: 0; } to { opacity: 1; } }
}
