Slice · AI prompt
Page-container width preference with contained, wide, and full modes. Persists per device in localStorage, synchronizes same-tab and cross-tab changes, and ships a toggle plus container wrapper. React/Next remains the default distribution; Svelte 5 / SvelteKit is available explicitly with --framework sveltekit.
# Install `full-width-toggle` — Full Width Toggle
> Page-container width preference with contained, wide, and full modes.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/full-width-toggle
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=full-width-toggle
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/full-width-toggle
## 1. Install
```bash
npx rr add full-width-toggle
# alias: npx rr add full-width-toggle
```
The CLI copies `frontend/slices/full-width-toggle/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `lucide-react`
- shadcn primitives: `button`
## 3. Wire it up
Run `npx rr add full-width-toggle` for the React/Next default, or `npx rr add full-width-toggle --framework sveltekit` for Svelte 5/SvelteKit. Place <FullWidthToggle variant="icon|button|segment" /> in an app-shell action slot and wrap page content in <WidthContainer as="main">. Storage key is `layout:widthMode`; modes are contained, wide, and full, with same-tab plus cross-tab sync.
## 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.