@solar-icons/react 2.0.0-beta.1 → 2.0.0-beta.2
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 +30 -65
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,93 +1,58 @@
|
|
|
1
|
-
# @solar-icons/react
|
|
1
|
+
# @solar-icons/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components for Solar Icons. This package provides 7,476 SVG icons across 6 styles (Bold, Broken, Linear, Outline, Bold Duotone, Line Duotone), optimized for React applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **7,476 SVGs:** 1,246 unique icons in 6 styles. Designed by 480 Design.
|
|
8
|
+
- **Tree-shakeable:** Import only the icons you use.
|
|
9
|
+
- **Global configuration:** Set defaults for size, color, and stroke width using `<SolarProvider>`.
|
|
10
|
+
- **Customizable:** Override size, color, and stroke width per icon via props or CSS variables.
|
|
11
|
+
- **Duotone support:** Secondary color controls for `bold-duotone` and `line-duotone` styles.
|
|
12
|
+
- **TypeScript:** Typed components and props.
|
|
8
13
|
|
|
9
|
-
Install
|
|
14
|
+
## Install
|
|
10
15
|
|
|
11
|
-
```
|
|
12
|
-
npm install @solar-icons/react
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
or
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
yarn add @solar-icons/react-perf
|
|
16
|
+
```sh
|
|
17
|
+
npm install @solar-icons/react
|
|
19
18
|
```
|
|
20
19
|
|
|
21
20
|
## Usage
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Import icons from the package:
|
|
26
|
-
|
|
27
|
-
```jsx
|
|
28
|
-
import { AltArrowLeft, CheckCircle } from '@solar-icons/react-perf/Linear'
|
|
22
|
+
```tsx
|
|
23
|
+
import { HomeIcon, LoginIcon } from '@solar-icons/react/linear'
|
|
29
24
|
|
|
30
25
|
function App() {
|
|
31
26
|
return (
|
|
32
27
|
<div>
|
|
33
|
-
<
|
|
34
|
-
<
|
|
28
|
+
<HomeIcon />
|
|
29
|
+
<LoginIcon color="#3b82f6" size={32} strokeWidth={2} />
|
|
35
30
|
</div>
|
|
36
31
|
)
|
|
37
32
|
}
|
|
38
33
|
```
|
|
39
34
|
|
|
40
|
-
###
|
|
41
|
-
|
|
42
|
-
```jsx
|
|
43
|
-
import { AltArrowLeft, ArrowUp } from '@solar-icons/react-perf/category/arrows/Linear'
|
|
44
|
-
import { Cart, Bag } from '@solar-icons/react-perf/category/shopping/Bold'
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Key Features
|
|
48
|
-
|
|
49
|
-
- **Performance-Oriented**: Each icon is packaged individually, ensuring that only the required assets are included in the final bundle.
|
|
50
|
-
- **Single-Style Icons**: Icons are separated by style (e.g., `Bold`, `Linear`), enabling more precise imports.
|
|
51
|
-
- **Lightweight SVGs**: Each icon is optimized for minimal SVG size to reduce load times.
|
|
52
|
-
|
|
53
|
-
### Properties
|
|
54
|
-
|
|
55
|
-
Each icon component supports the following properties:
|
|
56
|
-
|
|
57
|
-
- **`size`**: Defines the size of the icon (e.g., `24`, `"1.5em"`).
|
|
58
|
-
- **`color`**: Sets the color of the icon (e.g., `"#000"`, `"currentColor"`).
|
|
59
|
-
- **`mirrored`**: Flips the icon horizontally when set to `true`.
|
|
35
|
+
### Global Configuration (Provider)
|
|
60
36
|
|
|
61
|
-
|
|
37
|
+
Wrap your application in `<SolarProvider>` to set default properties:
|
|
62
38
|
|
|
63
|
-
|
|
39
|
+
```tsx
|
|
40
|
+
import { SolarProvider } from '@solar-icons/react'
|
|
41
|
+
import { HomeIcon } from '@solar-icons/react/linear'
|
|
64
42
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return <ArrowUpBold size="48" className="custom-class" />
|
|
43
|
+
function App() {
|
|
44
|
+
return (
|
|
45
|
+
<SolarProvider size={24} color="currentColor" strokeWidth={1.5}>
|
|
46
|
+
<HomeIcon />
|
|
47
|
+
</SolarProvider>
|
|
48
|
+
)
|
|
72
49
|
}
|
|
73
50
|
```
|
|
74
51
|
|
|
75
|
-
##
|
|
76
|
-
|
|
77
|
-
Unlike the versatile `@solar-icons/react` package, `@solar-icons/react-perf` focuses solely on direct imports for enhanced performance and reduced overhead. This package avoids using a provider or dual SSR/CSR support to ensure lightweight integration.
|
|
52
|
+
## Documentation
|
|
78
53
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Contributions to further optimize and expand the `@solar-icons/react-perf` package are welcome. If you wish to contribute, please follow our [contribution guidelines](../../CONTRIBUTING.md).
|
|
54
|
+
For installation guides, API reference, and a searchable icon catalog, visit the [React Documentation](https://solar-icons.vercel.app/docs/v2/frameworks/react).
|
|
82
55
|
|
|
83
56
|
## License
|
|
84
57
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## Acknowledgements
|
|
88
|
-
|
|
89
|
-
Special thanks to **480 Design** for creating the original Solar icon pack. Additional appreciation goes to **Phosphor Icons** and **Lucide Icons** for their inspiration in shaping the design and approach of the Solar icon packages.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
For more details on other packages and usage examples, refer to the [project's main documentation](../../README.md).
|
|
58
|
+
MIT License. Icons by 480 Design (CC BY 4.0).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solar-icons/react",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"tsdown": "^0.22.4",
|
|
85
85
|
"typescript": "^6.0.3",
|
|
86
86
|
"vitest": "^4.1.10",
|
|
87
|
-
"@solar-icons/core": "2.0.0-beta.
|
|
87
|
+
"@solar-icons/core": "2.0.0-beta.1"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"react": ">= 16.8",
|