Auto Install (CLI)
The easiest and recommended way to install FilterCN. The CLI automatically detects your project layout, scaffolds all 19 files, and installs peer dependencies.
Prerequisites
Since FilterCN is built on top of shadcn/ui, ensure it is configured first. Install the required components:
bash
npx shadcn@latest add button input select popover calendar command badgeRun the CLI
Navigate to your project root and run:
>_
pnpm dlx filtercn initWhat the CLI Does
When you run the command, it will:
- Detect your project layout — whether you use
src/componentsor justcomponents, and yourtsconfig.jsonpath alias (e.g.@/). - Scaffold a new
conditional-filter/folder containing 19 files (types, hooks, helpers, UI components, and provider). - Install dependencies — it checks your
package.jsonforlucide-reactanddate-fns, and asks to install them if missing.
Once the CLI prints ✨ FilterCN installed successfully!, you're ready to go.
Next Step
Head to Usage Examples to start filtering.