dazpixel
v0.4.0
Published
Pixel art SVG icon library for React
Readme
dazpixel
Pixel art SVG icon library for React.
Installation
npm install dazpixel
# or
pnpm add dazpixelUsage
import { ArrowRight, Star } from 'dazpixel';
// Default 16px
<ArrowRight />
// Custom size via prop
<Star size={32} />
// Custom color via CSS
<ArrowRight style={{ color: '#ff6b6b' }} />
// With Tailwind — CSS size overrides the size prop
<Star className="w-8 h-8 text-blue-500" />Why crispEdges
All icons use shape-rendering="crispEdges" so they stay sharp at any size, not just 16px. Every SVG coordinate is an integer aligned to whole pixels, giving you true pixel art rendering without anti-aliasing blur. This means icons look crisp whether you display them at 16px, 32px, or 128px.
Contributing a new icon
Create the component at
src/icons/MyIcon.tsxusingIconBase:import { IconBase } from '../IconBase'; import type { IconProps } from '../types'; export function MyIcon(props: IconProps) { return ( <IconBase {...props}> <rect x={6} y={2} width={2} height={2} /> {/* more rects ... */} </IconBase> ); }All SVG coordinates must be whole numbers — no decimals.
viewBox is always
0 0 16 16(handled byIconBase).Export from
src/icons/index.ts:export { MyIcon } from './MyIcon';Run
pnpm buildand verify it renders on the web app.Naming convention: PascalCase, descriptive noun (e.g.
ChevronDown, notArrow2).
