React · SVG icons

React Zero Icon Sprite.

React Zero Icon Sprite brings Lucide and Tabler icons to React. At build time, it puts the icons your app uses into a single SVG file the browser can cache.

Icons in the sprite.

The build scans your React source and includes the built-in and custom icons it finds.

Lucide and Tabler

Import outline icons from either set and filled icons from Tabler. Set their size and color with React props or CSS.

Custom artwork

Keep your own SVGs in the public folder and give CustomIcon a literal file path. The build includes the referenced artwork in the same sprite.

How the browser reuses an icon.

A search icon in the header and another in a toolbar can both reference the same drawing. Each instance points to a symbol in the generated SVG file, which the browser can reuse across pages.

Icons from the Icon Sprite demo.

The Icon Sprite demo displaying 24 Lucide and Tabler icons, including a bell, a calendar, the GitHub logo, and a search icon.

Add Icon Sprite to React.

Use React 17 or later. The build supports Node.js 22.x from 22.18 onward, or Node.js 24.11 and later.

  1. Install the package.

    Run npm install @react-zero-ui/icon-sprite in your React project.

  2. Import your icons.

    Use named imports such as Mail or IconHeartFilled. Built-in icons render inline during development.

  3. Generate the production sprite.

    Run npx zero-icons before your app build, or add zero-icons to your prebuild script. By default it writes public/icons.svg.