Slice · AI prompt
React + Svelte emoji/Lucide/Phosphor picker with shared search, tint, recents, and smart positioning.
# Install `icon-picker` — Icon Picker
> React + Svelte emoji/Lucide/Phosphor picker with shared search, tint, recents, and smart positioning.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/icon-picker
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=icon-picker
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/icon-picker
## 1. Install
```bash
npx rahman-resources add icon-picker
# alias: npx rr add icon-picker
```
The CLI copies `frontend/slices/icon-picker/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `lucide-react`, `@phosphor-icons/react`
- shadcn primitives: `popover`, `dialog`, `button`, `input`, `scroll-area`, `tabs`
## 3. Wire it up
React/default: `npx rr add icon-picker`. SvelteKit: append `--framework sveltekit`. Store raw emoji, `lucide:Name`, or `phosphor:Name` with optional `?c=hex`; parse/build helpers are shared. Both renderers share recents/style/search/handler/tool cores. Use IconPicker/IconPickerPopover for smart floating UI, IconPickerInline for an existing sheet/dialog, and DynamicIcon for rendering stored values.
## 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.