rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Motion Kit — scroll reveals, carousel, accordion, micro-interactions

Tasteful entrance animations with no motion library: Reveal/Stagger/CountUp/Marquee + embla carousel + radix accordion. Reduced-motion safe.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
motion-kit.prompt.mdmarkdown
# Install `motion-kit` — Motion Kit — scroll reveals, carousel, accordion, micro-interactions

> Tasteful entrance animations with no motion library: Reveal/Stagger/CountUp/Marquee + embla carousel + radix accordion. Reduced-motion safe.

📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail   : https://resource.rahmanef.com/slices/motion-kit
🧠 JSON catalog   : https://resource.rahmanef.com/api/knowledge?slice=motion-kit
🔗 Source         : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/motion-kit

## 1. Install

```bash
npx rahman-resources add motion-kit
# alias: npx rr add motion-kit
```

The CLI copies `frontend/slices/motion-kit/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.

## 2. What it ships

- npm: `embla-carousel-react`, `embla-carousel-autoplay`, `radix-ui`, `lucide-react`
- shadcn primitives: `button`

## 3. Wire it up

Run `npx rr add motion-kit`. Append the contents of `globals-motion.css` to your `app/globals.css` (after `@import "tailwindcss";`) — without it `data-reveal` elements stay static and the accordion snaps. Then import from `@/features/motion-kit`: `<Reveal variant="fade-up">`, `<Stagger itemClassName="h-full">{cards}</Stagger>` for grids, `<CountUp value={4800} />` (integers), `<Marquee speed={32}>{logos}</Marquee>`. Carousel: pair with `Autoplay` from embla-carousel-autoplay. Any component consuming a passed render/icon fn AND these hooks must be `"use client"`. Hover-lift convention: `transition-[translate,box-shadow] duration-300 hover:-translate-y-1 hover:shadow-lg`.

## Rules of engagement

- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice

The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.