Sly v2 (with Iconify support) is now in pre-release
npm i --save-dev https://pkg.pr.new/jacobparis-insiders/sly/@sly-cli/sly@71
Run this command and icons will appear in your codebase
> npx @sly-cli/sly add
Powered by Iconify
There's probably a better way to list all of these
Spritesheets are the fastest and most efficient way to ship icons.
Use a vite plugin to bundle a directory of SVG icons into a spritesheet.
Bundle your spritesheet with a CLI tool that integrates with Sly's postinstall command.
Create a manual postinstall script that reads your icons directory and assembles a spritesheet.
Use this component for type-safe icons in any project.
import { type IconName } from './icons/name'; import href from './icons/sprite.svg'; export async function Icon({ name, className, ...props }: React.SVGProps<SVGSVGElement> & { name: IconName; }) { return ( <svg {...props} className={`inline self-center ${className}`}> <use href={`${href}#${name}`} /> </svg> ); }