Serve
Banners, announcements. Rises, hangs at the top for a beat, comes down hard.
- Sport
- Tennis
- Move
- Rises, hangs at the top for a beat, comes down hard.
- For
- Banners, announcements
toss, hang, hit 760ms · out 192ms · reduced: fade
01 Install
npx shadcn@latest add https://moveui-red.vercel.app/r/serve.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/serve/serve.css";
{news && (
<div key={news.id} className="ml-serve" data-open="" role="status">
{news.text}
</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 "Serve" piece to this project. It's for: Banners, announcements.
1. Install it: npx shadcn@latest add https://moveui-red.vercel.app/r/serve.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/serve/serve.css";
{news && (
<div key={news.id} className="ml-serve" data-open="" role="status">
{news.text}
</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/serveWant 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
/*
Serve (tennis): the toss and the hit. For banners and announcements.
In (--ml-dur-flight): rises past its place, hangs at the top for a beat, comes down hard and
squashes a little on contact. Out (--ml-dur-exit): lifts and fades, no bounce.
Put .ml-serve on any element that you show with [data-open], a native [popover], or simply mount
(add [data-open] when it mounts). Reduced motion: a plain fade.
*/
.ml-serve {
opacity: 0;
translate: 0 -6px;
transition:
opacity var(--ml-dur-exit) var(--ml-ease-out),
translate var(--ml-dur-exit) var(--ml-ease-out),
overlay var(--ml-dur-exit) allow-discrete,
display var(--ml-dur-exit) allow-discrete;
}
.ml-serve[data-open],
.ml-serve:popover-open {
opacity: 1;
translate: 0 0;
transform-origin: 50% 100%;
animation: ml-serve-in var(--ml-dur-flight) both;
}
@keyframes ml-serve-in {
/* the toss: up past its place */
0% { opacity: 0; transform: translateY(18px) scale(0.97); animation-timing-function: var(--ml-ease-out); }
32% { opacity: 1; transform: translateY(-10px); animation-timing-function: linear; }
/* the hang at the top of the toss */
52% { transform: translateY(-11px); animation-timing-function: cubic-bezier(0.6, 0, 0.95, 0.4); }
/* the hit: down hard, squash on contact */
70% { transform: translateY(0) scale(var(--ml-impact-x), var(--ml-impact-y)); animation-timing-function: var(--ml-ease-out); }
84% { transform: translateY(-2px) scale(calc(2 - var(--ml-impact-x)), calc(2 - var(--ml-impact-y))); }
100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
.ml-serve { translate: none; }
@keyframes ml-serve-in { from { opacity: 0; } to { opacity: 1; } }
}
