rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Sections — composable marketing/landing sections

Marketing/landing-page composition: admin CRUD + config-driven public section renderers (stats/testimonials/pricing/faq/newsletter/custom). Absorbs the old feature-grid/faq-section/pricing-page/testimonials-grid/blog-section/portfolio-section/changelog-feed slugs.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
sections.prompt.mdmarkdown
# Install `sections` — Sections — composable marketing/landing sections

> Marketing/landing-page composition: admin CRUD + config-driven public section renderers (stats/testimonials/pricing/faq/newsletter/custom). Absorbs the old feature-grid/faq-section/pricing-page/testimonials-grid/blog-section/portfolio-section/changelog-feed slugs.

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

## 1. Install

```bash
npx rahman-resources add sections
# alias: npx rr add sections
```

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

## 2. What it ships

- npm: `lucide-react`, `embla-carousel-autoplay`, `next`
- shadcn primitives: `accordion`, `badge`, `button`, `card`, `carousel`, `dialog`, `input`, `label`, `select`, `switch`, `table`, `textarea`

## 3. Wire it up

Run `npx rr add sections`. Fold `landingReducer` into your root reducer (cases LANDING_UPSERT + LANDING_DELETE), seed State.landingSections with `defaultLandingSections()`, wrap your StoreProvider with `<LandingProvider value={adapter}/>` where adapter maps {items, publicBase, adminBase, create, update, remove} from your dispatch. Mount `<LandingView/>` at `/admin/landing` and `<LandingEditorView id={params.id}/>` at `/admin/landing/[id]`. In HomePage iterate `state.landingSections.filter(s => s.enabled).sort((a,b) => a.order - b.order)` and render each inside `<LandingSectionShell section={s}>`; for stats/testimonials/pricing/faq/newsletter/custom kinds drop in the shipped `<StatsSection/>` etc. (they read `section.config` JSON over your template defaults), or map the remaining kinds (hero/features/blog/etc.) to your own renderer. Use `parseConfigBadge(section.config)` for a section badge. Requires the template-base shared surface that ships in every rr website template: `@/components/templates/_shared/motion` (Reveal/Stagger/CountUp/Marquee/useInView — the motion-kit primitives), `@/components/templates/_shared/ui/section-head`, and `@/components/templates/_shared/crud/*`. Sections also use shadcn accordion/card/carousel + embla-carousel-autoplay.

## 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.