novaicons
v1.2.1
Published
Core vanilla JS icon components for 2674+ icons in 2 weights (Outline & Filled). Tree-shakeable, TypeScript-ready.
Maintainers
Readme
Novaicons is the core vanilla JavaScript package for Novaicons — a free, open-source SVG icon library featuring 2674+ handcrafted, grid-aligned icons. Use it directly as ES modules, or load via CDN with zero build step. Every icon is tree-shakeable, fully TypeScript-ready, and ships with no dependencies.
| 🔗 Resource | Link | |---|---| | 🌐 Website & icon browser | novaicons.dev | | 📖 Documentation | novaicons.dev/docs | | ⚛️ React package | novaicons-react | | 🎨 Figma plugin | novaicons.dev/docs/figma |
Install
npm i novaicons
# or
bun add novaicons
# or
yarn add novaiconsCDN (no build step required)
<script src="https://unpkg.com/novaicons@latest"></script>No bundler, no framework — just a <script> tag.
Usage
Vanilla JS — create SVG elements
import { Home, ShieldCheck, AltArrowDown } from 'novaicons';
document.body.appendChild(Home());
document.body.appendChild(ShieldCheck({ size: 32, color: '#d97757' }));
document.body.appendChild(AltArrowDown({ weight: 'Filled' }));Get SVG as a string
import { Home } from 'novaicons';
const svgString = Home.toSvg({ size: 32, color: 'red' });
element.innerHTML = svgString;Weights
Every icon ships in two weights — Outline (default) and Filled:
import { Home } from 'novaicons';
Home() // Outline (default)
Home({ weight: 'Filled' }) // FilledSizing & coloring
Home({ size: 32 }) // 32×32px
Home({ size: 48, color: 'red' }) // Custom size and color
Home({ color: 'currentColor' }) // Inherits parent text colorCDN / Script tag
<script src="https://unpkg.com/novaicons@latest"></script>
<script>
document.body.appendChild(novaicons.Home());
document.body.appendChild(novaicons.ShieldCheck({ size: 32, color: '#d97757' }));
</script>Direct icon import (smallest bundle)
import Home from 'novaicons/icons/Home';
import ShieldCheck from 'novaicons/icons/ShieldCheck';Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| size | number | string | 24 | Icon width & height (number = px) |
| color | string | — | Primary icon stroke/fill color. Leave unset to use CSS. |
| weight | 'Outline' | 'Filled' | 'Outline' | Icon style variant |
| strokeWidth | number | string | — | Override the default stroke width |
| className | string | — | Additional CSS class on the <svg> element |
| attrs | object | — | Any additional SVG attributes |
Tree-shaking
Every icon is a standalone ES module. Modern bundlers — Vite, Webpack, Rollup, esbuild — automatically tree-shake unused icons, keeping only what you import.
// ✅ Only Home is included in your production bundle
import { Home } from 'novaicons';
// ✅ Even smaller — direct path import skips the barrel file entirely
import Home from 'novaicons/icons/Home';The package is marked "sideEffects": false for optimal dead-code elimination.
Icon Names
Icons use PascalCase, derived from their original kebab-case file names:
| Original name | PascalCase import |
|---------------|-------------------|
| home | Home |
| shield-check | ShieldCheck |
| alt-arrow-down | AltArrowDown |
| shopping-cart | ShoppingCart |
| user-circle | UserCircle |
Browse and search all 2674+ icons at novaicons.dev.
TypeScript
Full type declarations ship with the package — no separate @types/ installation needed.
import { Home, IconOptions, IconWeight } from 'novaicons';
const weight: IconWeight = 'Filled';
const options: IconOptions = { size: 32, color: '#d97757', weight };
const svg: SVGSVGElement = Home(options);
document.body.appendChild(svg);Exported types
| Type | Description |
|------|-------------|
| IconOptions | Options for creating an SVG element |
| IconWeight | 'Outline' | 'Filled' |
Features
- 2674+ icons — Handcrafted, pixel-perfect SVGs across a wide range of categories
- Two weights — Outline and Filled, with consistent 24×24 grid alignment
- Tree-shakeable — Import only what you use; every icon is a standalone ES module
- Zero dependencies — No runtime overhead whatsoever
- TypeScript-ready — Full type declarations included, no extra packages needed
- CDN ready — Drop a
<script>tag and start using icons immediately toSvg()helper — Get raw SVG markup for any framework or template- MIT licensed — Free for personal and commercial use
Related packages
| Package | Description |
|---------|-------------|
| novaicons | This package. Core vanilla JS + CDN runtime. No framework required. |
| novaicons-react | React components for 2674+ icons. |
| novaicons-vue | Vue 3 components for 2674+ icons. |
| novaicons-svelte | Svelte components for 2674+ icons. |
Links
- 🌐 Website: novaicons.dev
- 📖 Documentation: novaicons.dev/docs
- 📦 npm: npmjs.com/package/novaicons
- 🐙 GitHub: github.com/dqev/novaicons
- 🐛 Issues: github.com/dqev/novaicons/issues
License
MIT © Dev Chauhan
Free to use in personal and commercial projects. Attribution is appreciated but not required.
