Skip to content

Commit 0523d48

Browse files
committed
more v2 updates
1 parent 4a788ed commit 0523d48

File tree

4 files changed

+118
-24
lines changed

4 files changed

+118
-24
lines changed

README.md

Lines changed: 109 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,143 @@
11
![Pixelarticons Cover](cover.jpg "Pixelarticons Cover")
2-
# Pixelarticons
32

4-
![npm](https://img.shields.io/npm/v/pixelarticons.svg?color=green&label=npm&style=popout-square)
5-
![npm](https://img.shields.io/npm/dt/pixelarticons.svg?color=blue&style=popout-square)
3+
# Pixelarticons
64

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+
[![npm version](https://img.shields.io/npm/v/pixelarticons.svg?color=black&label=npm&style=flat-square)](https://www.npmjs.com/package/pixelarticons)
6+
[![npm downloads](https://img.shields.io/npm/dt/pixelarticons.svg?color=black&style=flat-square)](https://www.npmjs.com/package/pixelarticons)
7+
[![License: MIT](https://img.shields.io/badge/license-MIT-black.svg?style=flat-square)](LICENSE)
88

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.
1010

11-
- [🌐 Pixelarticons website](https://pixelarticons.com "Pixelarticons - Website")
11+
- [🌐 Browse all icons](https://pixelarticons.com)
1212
- [🎨 Figma community file](https://www.figma.com/community/file/952542622393317653/Pixelarticons)
13-
- Use them directly in your code: 👇
1413

15-
## Getting Started
14+
---
1615

17-
### Install via package manager
16+
## Installation
1817

1918
```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>
2170
```
2271

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:
2477

2578
```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" />
2780
```
2881

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+
---
3085

31-
### Generate webfonts
86+
### Webfont
3287

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/`:
3489

3590
```bash
3691
npm run font
3792
```
3893

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+
39117
## Contributing
40118

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
42124

43-
Useful commands when working on icons:
125+
**Useful commands:**
44126

45127
```bash
46128
npm run validate # check all SVGs against design rules
47129
npm run browser # preview all icons in a local HTML file
48130
```
49131

50-
## Where to find us
132+
---
133+
134+
## Links
51135

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)
55139
- [GitHub Issues](https://github.com/halfmage/pixelarticons/issues)
140+
141+
---
142+
143+
MIT © [Gerrit Halfmann](https://github.com/halfmage)

bin/pull.js renamed to bin/upgrade.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function spinner(text) {
4545
const keyArg = process.argv.slice(2).find((a) => a.startsWith('--key='));
4646

4747
if (!keyArg || !keyArg.slice('--key='.length).trim()) {
48-
console.error('Usage: npx pixelarticons pull --key=YOUR_LICENSE_KEY');
48+
console.error('Usage: npx pixelarticons upgrade --key=YOUR_LICENSE_KEY');
4949
process.exit(1);
5050
}
5151

@@ -91,7 +91,13 @@ postJSON(VERIFY_URL, { licenseKey })
9191
.then(({ tmpFile, s2 }) => {
9292
execSync(`unzip -o "${tmpFile}" -d "${svgDir}"`, { stdio: 'ignore' });
9393
fs.unlinkSync(tmpFile);
94-
s2.succeed('Upgraded — All icons are now available!\n');
94+
s2.succeed('Icons downloaded');
95+
96+
const root = path.join(__dirname, '..');
97+
const s3 = spinner('Generating React components...');
98+
execSync('npm run generate:react', { cwd: root, stdio: 'ignore' });
99+
execSync('npm run build:react', { cwd: root, stdio: 'ignore' });
100+
s3.succeed('Done — All 2000+ icons are now available as SVGs and React components!\n');
95101
})
96102
.catch((err) => {
97103
process.stderr.write(`\r${RED}${RESET} ${err.message}\n`);

cover.jpg

-17.4 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"react": ">=16"
88
},
99
"bin": {
10-
"pixelarticons": "bin/pull.js"
10+
"pixelarticons": "bin/upgrade.js"
1111
},
1212
"scripts": {
1313
"font": "svgtofont --sources ./svg --output ./fonts",

0 commit comments

Comments
 (0)