Whistle
Tooltips. The referee's whistle: a quick lift, no bounce.
Video checkOffsideSubstitution
- Sport
- Football
- Move
- The referee's whistle: a quick lift, no bounce.
- For
- Tooltips
waits 300ms, lifts 200ms · hides at once · tooltips
01 Install
npx shadcn@latest add https://moveui-red.vercel.app/r/whistle.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/surfaces/whistle.css";
// Shows on hover and keyboard focus. Position the tooltip with your own CSS.
<span className="ml-whistle-host">
<button aria-describedby="tip-save">Save</button>
<span id="tip-save" role="tooltip" className="ml-whistle">Saves a draft</span>
</span>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 "Whistle" piece to this project. It's for: Tooltips.
1. Install it: npx shadcn@latest add https://moveui-red.vercel.app/r/whistle.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/surfaces/whistle.css";
// Shows on hover and keyboard focus. Position the tooltip with your own CSS.
<span className="ml-whistle-host">
<button aria-describedby="tip-save">Save</button>
<span id="tip-save" role="tooltip" className="ml-whistle">Saves a draft</span>
</span>
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/whistleWant 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
/*
Whistle: a quick lift and fade, no bounce. For tooltips.
Waits --ml-delay-hint before showing (so passing the pointer over things stays quiet),
never waits before hiding. Enter --ml-dur-quick, exit --ml-dur-tap.
CSS only: put .ml-whistle inside a .ml-whistle-host (shows on hover and keyboard focus),
or toggle [data-open] / use a native [popover]. Reduced motion: opacity only.
*/
.ml-whistle {
--_from: translateY(4px);
opacity: 0;
transform: var(--_from);
pointer-events: none;
transition:
opacity var(--ml-dur-tap) var(--ml-ease-out),
transform var(--ml-dur-tap) var(--ml-ease-out),
overlay var(--ml-dur-tap) allow-discrete,
display var(--ml-dur-tap) allow-discrete;
}
.ml-whistle-host:hover > .ml-whistle,
.ml-whistle-host:has(:focus-visible) > .ml-whistle,
.ml-whistle:popover-open,
.ml-whistle[data-open] {
opacity: 1;
transform: none;
transition:
opacity var(--ml-dur-quick) var(--ml-ease-out) var(--ml-delay-hint),
transform var(--ml-dur-quick) var(--ml-ease-out) var(--ml-delay-hint),
overlay var(--ml-dur-quick) allow-discrete var(--ml-delay-hint),
display var(--ml-dur-quick) allow-discrete var(--ml-delay-hint);
}
@starting-style {
.ml-whistle:popover-open,
.ml-whistle[data-open] { opacity: 0; transform: var(--_from); }
}
@media (prefers-reduced-motion: reduce) {
.ml-whistle { --_from: none; }
}
