denji init
Initialize a new Denji project
Initialize a new project with config file and icons template.
Usage
denji init [options]Options
--output
Type: string
Specify output file path.
denji init --output ./src/components/icons.tsx--output-type
Type: "file" | "folder"
Output type. Defaults to file for React/Preact/Solid/Qwik/Vue and folder for Svelte.
denji init --output-type folder--framework
Type: "react" | "preact" | "solid" | "qwik" | "vue" | "svelte"
Target framework for generated components.
denji init --framework react
denji init --framework preact
denji init --framework solid
denji init --framework qwik
denji init --framework vue
denji init --framework svelte--typescript
Type: boolean
Default: true
Generate TypeScript output.
denji init --typescript--a11y
Type: "hidden" | "img" | "title" | "presentation" | "false"
Set default accessibility strategy.
denji init --a11y hidden--forward-ref
Type: boolean
Default: false
Use forwardRef for icon components (React and Preact only).
denji init --forward-ref
denji init --no-forward-ref--track-source / --no-track-source
Type: boolean
Default: true
Track Iconify source names by adding data-icon attribute to icons.
denji init --track-source
denji init --no-track-sourceWhat Gets Created
Running denji init creates:
- denji.json - Configuration file
{ "$schema": "./node_modules/denji/configuration_schema.json", "output": "./src/icons.tsx", "framework": "react", "typescript": true, "trackSource": true }
If Denji is not installed locally (e.g., using npx, bunx, pnpx, yarn dlx), use the remote schema URL instead:
{
"$schema": "https://denji-docs.vercel.app/configuration_schema.json"
}- Icons file or folder depending on output type:
- File mode: a single template file (e.g.,
icons.tsx) - Folder mode: an output directory with barrel file and types
- File mode: a single template file (e.g.,
The init command is safe to run multiple times. It won't overwrite existing configs.
Examples
Basic initialization:
denji initCustom output path:
denji init --output ./components/icons.tsxWith accessibility:
denji init --a11y hidden --output ./src/icons.tsx