Slice · AI prompt
ResponsiveDialog — auto-switches between bottom Sheet (mobile) and centered Dialog (desktop) at the md breakpoint. Same API as shadcn Dialog. Kitab forbids raw <dialog>; use this everywhere. Facade slice — pulls from template-base/frontend/slices/responsive-dialog.
# Install `responsive-dialog` — Responsive Dialog (Sheet ↔ Modal)
> ResponsiveDialog — auto-switches between bottom Sheet (mobile) and centered Dialog (desktop) at the md breakpoint.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/responsive-dialog
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=responsive-dialog
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/template-base/frontend/slices/responsive-dialog
## 1. Install
```bash
# alias: npx rr add responsive-dialog
```
The CLI copies `template-base/frontend/slices/responsive-dialog/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- shadcn primitives: `dialog`, `sheet`
## 3. Wire it up
Run `npx rr add responsive-dialog`. Drop-in for shadcn Dialog. Use <ResponsiveDialog><ResponsiveDialogTrigger>…</ResponsiveDialogTrigger><ResponsiveDialogContent>…</ResponsiveDialogContent></ResponsiveDialog>. On mobile renders as Sheet sliding from bottom; on desktop as centered Dialog. Threshold via useMediaQuery('(min-width: 768px)').
## 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.