Prerequisites
Before installing Anicon, make sure you have:shadcn/ui initialized in your project
shadcn/ui initialized in your project
Anicon uses the shadcn CLI for installation. You need a
components.json file in your project root.If you haven’t set up shadcn/ui yet, follow the shadcn/ui installation guide for your framework (Next.js, Vite, Remix, etc.).React 18+
React 18+
Anicon requires React 18 or later for full compatibility with Motion.
A package manager
A package manager
You’ll need npm, yarn, pnpm, or bun installed.
Installation Methods
Method 1: Install Individual Icons (Recommended)
Install specific icons on-demand using the shadcn CLI. This is the recommended approach as it keeps your bundle size minimal.Replace
icon-heart with any icon name from the Anicon gallery. The CLI will:- Copy the icon component to
components/ui/ - Install
motiondependency if not already present - Configure TypeScript types
Method 2: Install Multiple Icons
You can install multiple icons in a single command:What Gets Installed
When you install an icon, the shadcn CLI will:Create the component file
The icon component is copied to
components/ui/icon-[name].tsx (or your configured components directory).Install dependencies
If
motion isn’t already in your package.json, it will be installed automatically:package.json
Verify Installation
After installation, you should see the icon component in your project:Manual Installation
If you prefer not to use the CLI, you can manually copy icon components:Copy the icon component
Browse the Anicon gallery, find your icon, and copy the component code to
components/ui/icon-[name].tsx.Troubleshooting
Error: components.json not found
Error: components.json not found
Anicon requires a
components.json file created by shadcn/ui. Initialize shadcn first:Motion import errors
Motion import errors
Make sure If you’re using an older version of Framer Motion, Anicon requires the newer
motion is installed:motion package (formerly framer-motion).TypeScript errors
TypeScript errors
Ensure your
tsconfig.json includes the components directory:Next Steps
Quick Start Guide
Learn how to use your installed icons in your application