|
1 | 1 |  |
2 | | -# Pixelarticons |
3 | 2 |
|
4 | | - |
5 | | - |
| 3 | +# Pixelarticons |
6 | 4 |
|
7 | | -486 carefully handmade pixel art icons based on a 24×24 grid using `fill="currentColor"`. Each icon is drawn on the pixel grid without anti-aliasing for a crisp, consistent look. Use at 24px, 48px, 72px, or 96px for best results — other sizes will appear blurry. |
| 5 | +[](https://www.npmjs.com/package/pixelarticons) |
| 6 | +[](https://www.npmjs.com/package/pixelarticons) |
| 7 | +[](LICENSE) |
8 | 8 |
|
9 | | -## Get the icons |
| 9 | +**800 handcrafted pixel art icons** — drawn on a strict 24×24 grid, no anti-aliasing, pure `<path>` elements, `fill="currentColor"`. Works with React, as raw SVGs, via CDN, or as a webfont. |
10 | 10 |
|
11 | | -- [🌐 Pixelarticons website](https://pixelarticons.com "Pixelarticons - Website") |
| 11 | +- [🌐 Browse all icons](https://pixelarticons.com) |
12 | 12 | - [🎨 Figma community file](https://www.figma.com/community/file/952542622393317653/Pixelarticons) |
13 | | -- Use them directly in your code: 👇 |
14 | 13 |
|
15 | | -## Getting Started |
| 14 | +--- |
16 | 15 |
|
17 | | -### Install via package manager |
| 16 | +## Installation |
18 | 17 |
|
19 | 18 | ```bash |
20 | | -npm i pixelarticons |
| 19 | +npm install pixelarticons |
| 20 | +``` |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +### React |
| 27 | + |
| 28 | +Every icon ships as a ready-to-use React component with full TypeScript types. |
| 29 | + |
| 30 | +```jsx |
| 31 | +import { Heart, ArrowLeft, AddBox } from 'pixelarticons/react' |
| 32 | + |
| 33 | +export default function App() { |
| 34 | + return ( |
| 35 | + <div> |
| 36 | + <Heart width={48} height={48} /> |
| 37 | + <ArrowLeft className="text-blue-500" /> |
| 38 | + <AddBox style={{ color: 'red' }} /> |
| 39 | + </div> |
| 40 | + ) |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +Components accept all standard SVG props (`width`, `height`, `className`, `style`, `onClick`, …). The default size is `24×24`. For the sharpest rendering use multiples of 24: **24px, 48px, 72px, 96px**. |
| 45 | + |
| 46 | +**Tree-shakeable per-icon imports** keep bundles small: |
| 47 | + |
| 48 | +```jsx |
| 49 | +import { Heart } from 'pixelarticons/react/Heart' |
| 50 | +``` |
| 51 | + |
| 52 | +Icon names follow **PascalCase** matching their SVG filename (`arrow-left.svg` → `ArrowLeft`). Icons whose names start with a digit are prefixed with `Icon` (e.g. `4g.svg` → `Icon4G`). |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +### Raw SVG |
| 57 | + |
| 58 | +The `svg/` directory contains every icon as a standalone file — drop them directly into any project: |
| 59 | + |
| 60 | +```html |
| 61 | +<img src="node_modules/pixelarticons/svg/heart.svg" width="48" height="48" /> |
| 62 | +``` |
| 63 | + |
| 64 | +Or inline them for CSS color control: |
| 65 | + |
| 66 | +```html |
| 67 | +<svg viewBox="0 0 24 24" width="48" height="48" fill="currentColor"> |
| 68 | + <!-- paste path data from svg/heart.svg --> |
| 69 | +</svg> |
21 | 70 | ``` |
22 | 71 |
|
23 | | -### Use directly via unpkg |
| 72 | +--- |
| 73 | + |
| 74 | +### CDN (no install) |
| 75 | + |
| 76 | +Use any icon directly via [unpkg](https://unpkg.com) without installing anything: |
24 | 77 |
|
25 | 78 | ```html |
26 | | -<img src="https://unpkg.com/pixelarticons@latest/svg/file.svg" /> |
| 79 | +<img src="https://unpkg.com/pixelarticons@latest/svg/heart.svg" width="48" /> |
27 | 80 | ``` |
28 | 81 |
|
29 | | -Replace `file` with any icon name (e.g. `heart`, `arrow-left`, `add-box`). |
| 82 | +Replace `heart` with any icon name (kebab-case, e.g. `arrow-left`, `add-box`, `zoom-in`). |
| 83 | + |
| 84 | +--- |
30 | 85 |
|
31 | | -### Generate webfonts |
| 86 | +### Webfont |
32 | 87 |
|
33 | | -Outputs `.ttf`, `.woff`, `.woff2`, `.eot`, `.svg` fonts plus CSS/SCSS/React components into `./fonts/`: |
| 88 | +Generate `.ttf`, `.woff`, `.woff2`, `.eot`, `.svg` fonts plus CSS/SCSS stylesheets into `./fonts/`: |
34 | 89 |
|
35 | 90 | ```bash |
36 | 91 | npm run font |
37 | 92 | ``` |
38 | 93 |
|
| 94 | +Link the generated CSS and use icon classes in HTML: |
| 95 | + |
| 96 | +```html |
| 97 | +<link rel="stylesheet" href="fonts/pixelarticons.css" /> |
| 98 | +<i class="pixel-heart"></i> |
| 99 | +``` |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Unlock all 2000+ icons |
| 104 | + |
| 105 | +The free package includes 800 icons. If you purchased a license, run the upgrade command to unlock the full icon set: |
| 106 | + |
| 107 | +```bash |
| 108 | +npx pixelarticons upgrade --key=YOUR_LICENSE_KEY |
| 109 | +``` |
| 110 | + |
| 111 | +This verifies your license and downloads all icons directly into your local `svg/` directory — no extra setup needed. |
| 112 | + |
| 113 | +You can find your license key in your **Gumroad library** or in the **purchase confirmation email** you received from Gumroad. |
| 114 | + |
| 115 | +--- |
| 116 | + |
39 | 117 | ## Contributing |
40 | 118 |
|
41 | | -See [CONTRIBUTING.md](CONTRIBUTING.md) for design rules, naming conventions, and how to add new icons. |
| 119 | +Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for the full design rules and naming conventions. The short version: |
| 120 | + |
| 121 | +- `viewBox="0 0 24 24"`, `<path>` elements only, `fill="currentColor"` |
| 122 | +- Paths must align to the pixel grid — no sub-pixel coordinates |
| 123 | +- Filenames use kebab-case describing function, not appearance |
42 | 124 |
|
43 | | -Useful commands when working on icons: |
| 125 | +**Useful commands:** |
44 | 126 |
|
45 | 127 | ```bash |
46 | 128 | npm run validate # check all SVGs against design rules |
47 | 129 | npm run browser # preview all icons in a local HTML file |
48 | 130 | ``` |
49 | 131 |
|
50 | | -## Where to find us |
| 132 | +--- |
| 133 | + |
| 134 | +## Links |
51 | 135 |
|
52 | | -- [Website](https://www.pixelarticons.com "Pixelarticons - Website") |
53 | | -- [Instagram](https://www.instagram.com/pixelarticons/ "Pixelarticons - Instagram") |
54 | | -- [NPM](https://www.npmjs.com/package/pixelarticons "Pixelarticons - NPM") |
| 136 | +- [Website](https://pixelarticons.com) |
| 137 | +- [Instagram](https://www.instagram.com/pixelarticons/) |
| 138 | +- [NPM](https://www.npmjs.com/package/pixelarticons) |
55 | 139 | - [GitHub Issues](https://github.com/halfmage/pixelarticons/issues) |
| 140 | + |
| 141 | +--- |
| 142 | + |
| 143 | +MIT © [Gerrit Halfmann](https://github.com/halfmage) |
0 commit comments