# icons

This rule enforces icon imports from your project's configured library and removes manual sizing from components. Use it to keep all icons consistent across the codebase.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 7523 repo stars
- Author: Devin-AXIS
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Devin-AXIS/iPolloWork/tree/HEAD/.opencode/skills/shadcn/rules/icons.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/icons

## What it does

The rule sets three constraints. First: import icons from the library specified in your project's `iconLibrary` field. If it says `lucide`, use `lucide-react`; if `tabler`, use `@tabler/icons-react`. Never default to `lucide-react` without checking.

Second: add `data-icon="inline-start"` (before text) or `data-icon="inline-end"` (after text) to icons inside buttons and other components. Skip sizing classes like `mr-2 size-4` — the component handles those via CSS.

Third: pass icons as React components, not string keys. Instead of a lookup table with `icon="check"`, pass `icon={CheckIcon}`. This keeps types tight and prevents mapping mistakes.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/icons.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/icons.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/icons.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/icons.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/icons.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Devin-AXIS/iPolloWork/tree/HEAD/.opencode/skills/shadcn/rules/icons.md

## When to use it
- pick the correct icon package from project config and import from it
- place an icon in a button without extra sizing classes
- pass an icon to a component as a type-safe React component
- ensure all icons have consistent sizes and spacing

## Example prompts
- Check the project's `iconLibrary` and import `CheckIcon` from `lucide-react` if it's set to `lucide`
- Add an icon to a button with `data-icon="inline-start"` without `className="size-4"`
- Pass `icon={AlertIcon}` to `StatusBadge` instead of the string `icon="alert"`

## Similar
- [morphing-icons](https://affpapa.org/en/nevibecode/skills/morphing-icons.md) — skill · 362 installs
- [Keyline Icons](https://affpapa.org/en/nevibecode/mcp/keyline-icons.md) — MCP server · ★ 235 repo stars
- [Vadivam Icons](https://affpapa.org/en/nevibecode/mcp/vadivam-icons.md) — MCP server · ★ 14 repo stars
- [better-icons](https://affpapa.org/en/nevibecode/skills/better-icons.md) — skill · 6700 installs
- [suggest-lucide-icons](https://affpapa.org/en/nevibecode/skills/suggest-lucide-icons.md) — skill · 653 installs
- [icons-badges](https://affpapa.org/en/nevibecode/skills/icons-badges.md) — skill · 609 installs

From the same set: [devin-axis/ipollowork](https://affpapa.org/en/nevibecode/by/devin-axis/ipollowork.md) — 42 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
