thesvg 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -59
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,90 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://thesvg.org">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/GLINCKER/thesvg/main/public/logo-github.png" alt="theSVG" width="120" height="120" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<h3 align="center">thesvg</h3>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
3,800+ brand SVG icons for developers. Tree-shakeable, typed, open source.
|
|
11
|
+
<br />
|
|
12
|
+
<a href="https://thesvg.org"><strong>Browse all icons →</strong></a>
|
|
13
|
+
</p>
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://www.npmjs.com/package/thesvg"><img src="https://img.shields.io/npm/v/thesvg?color=F97316&label=npm" alt="npm version" /></a>
|
|
17
|
+
<a href="https://www.npmjs.com/package/thesvg"><img src="https://img.shields.io/npm/dm/thesvg?color=F97316" alt="npm downloads" /></a>
|
|
18
|
+
<a href="https://github.com/GLINCKER/thesvg/blob/main/packages/thesvg/LICENSE"><img src="https://img.shields.io/npm/l/thesvg?color=F97316" alt="license" /></a>
|
|
19
|
+
<a href="https://github.com/GLINCKER/thesvg"><img src="https://img.shields.io/github/stars/GLINCKER/thesvg?style=social" alt="GitHub stars" /></a>
|
|
20
|
+
</p>
|
|
8
21
|
|
|
9
|
-
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
This is the convenience package for [`@the-svg/icons`](https://www.npmjs.com/package/@the-svg/icons). Both packages contain the same 3,800+ icons.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
10
27
|
|
|
11
28
|
```bash
|
|
12
29
|
npm install thesvg
|
|
13
|
-
pnpm add thesvg
|
|
14
|
-
bun add thesvg
|
|
15
30
|
```
|
|
16
31
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
### Import a single icon (tree-shakeable)
|
|
32
|
+
## Quick Start
|
|
20
33
|
|
|
21
34
|
```ts
|
|
22
35
|
import github from "thesvg/github";
|
|
23
36
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Named exports
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
import { svg, title, hex, categories, variants } from "thesvg/github";
|
|
37
|
+
github.svg; // raw SVG string
|
|
38
|
+
github.title; // "GitHub"
|
|
39
|
+
github.hex; // "181717"
|
|
40
|
+
github.categories; // ["DevTool", "VCS"]
|
|
41
|
+
github.variants; // { default: "<svg...>", mono: "<svg...>" }
|
|
35
42
|
```
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
> Importing from the root includes all icons. Prefer individual imports when bundle size matters.
|
|
44
|
+
## Usage
|
|
40
45
|
|
|
41
46
|
```ts
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
// Named exports
|
|
48
|
+
import { svg, title, hex } from "thesvg/github";
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
// Barrel import (includes all icons)
|
|
51
|
+
import { github, vercel, stripe } from "thesvg";
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
// React
|
|
48
54
|
import { svg } from "thesvg/github";
|
|
55
|
+
const Logo = () => <div dangerouslySetInnerHTML={{ __html: svg }} />;
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Check available variants
|
|
56
|
-
|
|
57
|
-
```ts
|
|
58
|
-
import github from "thesvg/github";
|
|
59
|
-
|
|
60
|
-
// Keys: "default", "mono", "light", "dark", "wordmark", etc.
|
|
61
|
-
const monoSvg = github.variants["mono"];
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Icon module shape
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
interface IconModule {
|
|
68
|
-
slug: string; // URL-safe slug, e.g. "github"
|
|
69
|
-
title: string; // Brand name, e.g. "GitHub"
|
|
70
|
-
hex: string; // Brand color without "#", e.g. "181717"
|
|
71
|
-
categories: string[];
|
|
72
|
-
aliases: string[];
|
|
73
|
-
svg: string; // Raw SVG string (default variant)
|
|
74
|
-
variants: Record<string, string>;
|
|
75
|
-
license: string;
|
|
76
|
-
url: string;
|
|
77
|
-
}
|
|
57
|
+
// Variants
|
|
58
|
+
import icon from "thesvg/github";
|
|
59
|
+
const dark = icon.variants["dark"];
|
|
78
60
|
```
|
|
79
61
|
|
|
80
62
|
## CDN
|
|
81
63
|
|
|
82
64
|
```html
|
|
83
|
-
<img src="https://thesvg.org/icons/github/default.svg" alt="GitHub" width="24"
|
|
65
|
+
<img src="https://thesvg.org/icons/github/default.svg" alt="GitHub" width="24" />
|
|
84
66
|
```
|
|
85
67
|
|
|
68
|
+
## Packages
|
|
69
|
+
|
|
70
|
+
| Package | Description |
|
|
71
|
+
|---------|-------------|
|
|
72
|
+
| [`thesvg`](https://www.npmjs.com/package/thesvg) | Convenience wrapper (this package) |
|
|
73
|
+
| [`@the-svg/icons`](https://www.npmjs.com/package/@the-svg/icons) | Core icon data |
|
|
74
|
+
| `@the-svg/react` | React components (coming soon) |
|
|
75
|
+
| `@the-svg/cli` | CLI tool (coming soon) |
|
|
76
|
+
|
|
86
77
|
## License
|
|
87
78
|
|
|
88
|
-
Icons
|
|
79
|
+
MIT. Icons under their respective upstream licenses.
|
|
89
80
|
|
|
90
|
-
|
|
81
|
+
<p align="center">
|
|
82
|
+
<a href="https://thesvg.org">thesvg.org</a>
|
|
83
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thesvg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "3,800+ brand SVG icons - tree-shakeable, typed, dual ESM/CJS. The one-stop brand icon library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"homepage": "https://thesvg.org",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/GLINCKER/thesvg.git",
|
|
13
13
|
"directory": "packages/thesvg"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
16
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "https://github.com/GLINCKER/thesvg/issues"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"svg",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"nextjs"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@the-svg/icons": "0.
|
|
34
|
+
"@the-svg/icons": "0.3.0"
|
|
35
35
|
},
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|