@solar-icons/angular 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 +33 -137
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,170 +1,66 @@
|
|
|
1
1
|
# @solar-icons/angular
|
|
2
2
|
|
|
3
|
-
Solar Icons
|
|
3
|
+
Angular components for Solar Icons. This package provides 7,476 SVG icons across 6 styles (Bold, Broken, Linear, Outline, Bold Duotone, Line Duotone), optimized for Angular applications.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Static components
|
|
14
|
-
|
|
15
|
-
Import icons with the `Solar` prefix and style suffix, then use attribute selectors on `<svg>`:
|
|
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 `<solar-provider>`.
|
|
10
|
+
- **Customizable:** Override size, color, and stroke width per icon via inputs or CSS variables.
|
|
11
|
+
- **Duotone support:** Secondary color controls for `bold-duotone` and `line-duotone` styles.
|
|
12
|
+
- **TypeScript:** Typed components and inputs.
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
import { Component } from '@angular/core'
|
|
19
|
-
import { SolarHomeBold } from '@solar-icons/angular'
|
|
14
|
+
## Install
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
standalone: true,
|
|
24
|
-
imports: [SolarHomeBold],
|
|
25
|
-
template: ` <svg solarHomeBold [size]="32" color="#ef4444" /> `,
|
|
26
|
-
})
|
|
27
|
-
export class ExampleComponent {}
|
|
16
|
+
```sh
|
|
17
|
+
npm install @solar-icons/angular
|
|
28
18
|
```
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Wrap a subtree to share icon styling via CSS custom properties:
|
|
20
|
+
## Usage
|
|
33
21
|
|
|
34
|
-
```
|
|
22
|
+
```ts
|
|
35
23
|
import { Component } from '@angular/core'
|
|
36
|
-
import {
|
|
24
|
+
import { HomeIcon, LoginIcon } from '@solar-icons/angular/linear'
|
|
37
25
|
|
|
38
26
|
@Component({
|
|
39
|
-
selector: 'app-demo',
|
|
40
27
|
standalone: true,
|
|
41
|
-
imports: [
|
|
28
|
+
imports: [HomeIcon, LoginIcon],
|
|
42
29
|
template: `
|
|
43
|
-
<
|
|
44
|
-
<svg
|
|
45
|
-
<svg
|
|
46
|
-
</
|
|
30
|
+
<div>
|
|
31
|
+
<svg solarHomeIcon></svg>
|
|
32
|
+
<svg solarLoginIcon color="#3b82f6" size="32" strokeWidth="2"></svg>
|
|
33
|
+
</div>
|
|
47
34
|
`,
|
|
48
35
|
})
|
|
49
|
-
export class
|
|
36
|
+
export class AppComponent {}
|
|
50
37
|
```
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
| ------------------ | --------------------------- | -------------- |
|
|
54
|
-
| `color` | `--solar-color` | `currentColor` |
|
|
55
|
-
| `size` | `--solar-size` | `24px` |
|
|
56
|
-
| `strokeWidth` | `--solar-stroke-width` | `1.5` |
|
|
57
|
-
| `secondaryColor` | `--solar-secondary-color` | `currentColor` |
|
|
58
|
-
| `secondaryOpacity` | `--solar-secondary-opacity` | `0.5` |
|
|
59
|
-
|
|
60
|
-
### useSolar
|
|
39
|
+
### Global Configuration (Provider)
|
|
61
40
|
|
|
62
|
-
|
|
41
|
+
Wrap your components in `<solar-provider>` to set default properties:
|
|
63
42
|
|
|
64
|
-
```
|
|
43
|
+
```ts
|
|
65
44
|
import { Component } from '@angular/core'
|
|
66
|
-
import {
|
|
45
|
+
import { SolarProvider } from '@solar-icons/angular'
|
|
46
|
+
import { HomeIcon } from '@solar-icons/angular/linear'
|
|
67
47
|
|
|
68
48
|
@Component({
|
|
69
|
-
selector: 'app-controls',
|
|
70
49
|
standalone: true,
|
|
71
|
-
imports: [
|
|
50
|
+
imports: [SolarProvider, HomeIcon],
|
|
72
51
|
template: `
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[value]="solar.color()"
|
|
77
|
-
(input)="solar.setColor($any($event.target).value)" />
|
|
52
|
+
<solar-provider size="24" color="currentColor" strokeWidth="1.5">
|
|
53
|
+
<svg solarHomeIcon></svg>
|
|
54
|
+
</solar-provider>
|
|
78
55
|
`,
|
|
79
56
|
})
|
|
80
|
-
export class
|
|
81
|
-
readonly solar = useSolar()
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Wrap the component in a `<solar-provider>` ancestor:
|
|
86
|
-
|
|
87
|
-
```html
|
|
88
|
-
<solar-provider>
|
|
89
|
-
<app-controls />
|
|
90
|
-
</solar-provider>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Multi-style dynamic components
|
|
94
|
-
|
|
95
|
-
Import components that bundle all 6 styles and switch via `weight`:
|
|
96
|
-
|
|
97
|
-
```typescript
|
|
98
|
-
import { Component } from '@angular/core'
|
|
99
|
-
import { SolarHome } from '@solar-icons/angular/dynamic'
|
|
100
|
-
|
|
101
|
-
@Component({
|
|
102
|
-
selector: 'app-example',
|
|
103
|
-
standalone: true,
|
|
104
|
-
imports: [SolarHome],
|
|
105
|
-
template: `<svg solarHome weight="Bold" [size]="32" color="#ef4444" />`,
|
|
106
|
-
})
|
|
107
|
-
export class ExampleComponent {}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Available from `@solar-icons/angular/dynamic` (barrel) or `@solar-icons/angular/dynamic/home` (single).
|
|
111
|
-
|
|
112
|
-
### Dynamic rendering with `SolarIcon`
|
|
113
|
-
|
|
114
|
-
The `SolarIcon` directive renders icons at runtime from a class or registered name. Use it for data-driven scenarios.
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
import { Component } from '@angular/core'
|
|
118
|
-
import { SolarIcon, provideSolarIcons } from '@solar-icons/angular'
|
|
119
|
-
import { SolarHome } from '@solar-icons/angular/dynamic'
|
|
120
|
-
|
|
121
|
-
@Component({
|
|
122
|
-
selector: 'app-example',
|
|
123
|
-
standalone: true,
|
|
124
|
-
imports: [SolarIcon],
|
|
125
|
-
template: ` <ng-container [solarIcon]="myIcon" [weight]="'Bold'" [size]="32" /> `,
|
|
126
|
-
})
|
|
127
|
-
export class ExampleComponent {
|
|
128
|
-
myIcon = SolarHome
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
`SolarIcon` accepts `size`, `color`, `strokeWidth`, `weight`, `secondaryColor`, `secondaryOpacity`, `alt` — all forwarded to the created icon.
|
|
133
|
-
|
|
134
|
-
### CSS variables
|
|
135
|
-
|
|
136
|
-
Icons read from CSS custom properties when explicit inputs are omitted:
|
|
137
|
-
|
|
138
|
-
```css
|
|
139
|
-
:host {
|
|
140
|
-
--solar-color: #ef4444;
|
|
141
|
-
--solar-size: 32px;
|
|
142
|
-
--solar-stroke-width: 2;
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Accessibility
|
|
147
|
-
|
|
148
|
-
Icons have `aria-hidden="true"` by default. Provide `alt` or `ariaLabel` to make them accessible:
|
|
149
|
-
|
|
150
|
-
```html
|
|
151
|
-
<svg solarHomeBold alt="Home" /> <svg solarHomeBold ariaLabel="Navigate to home page" />
|
|
57
|
+
export class AppComponent {}
|
|
152
58
|
```
|
|
153
59
|
|
|
154
|
-
##
|
|
60
|
+
## Documentation
|
|
155
61
|
|
|
156
|
-
|
|
157
|
-
| ------------------ | ------------------ | ------------------------------ |
|
|
158
|
-
| `color` | `string` | Icon color |
|
|
159
|
-
| `size` | `string \| number` | Width and height |
|
|
160
|
-
| `strokeWidth` | `string \| number` | Stroke width |
|
|
161
|
-
| `secondaryColor` | `string` | Duotone accent color |
|
|
162
|
-
| `secondaryOpacity` | `number` | Duotone accent opacity |
|
|
163
|
-
| `isolated` | `boolean` | Ignores provider CSS variables |
|
|
164
|
-
| `alt` | `string` | Accessibility label |
|
|
165
|
-
| `ariaLabel` | `string` | `aria-label` attribute |
|
|
62
|
+
For installation guides, API reference, and a searchable icon catalog, visit the [Angular Documentation](https://solar-icons.vercel.app/docs/v2/frameworks/angular).
|
|
166
63
|
|
|
167
64
|
## License
|
|
168
65
|
|
|
169
|
-
|
|
170
|
-
- **Icons**: CC BY 4.0 by [480 Design](https://www.figma.com/community/file/1166831539721848736) (requires attribution)
|
|
66
|
+
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/angular",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"typescript": "~6.0.3",
|
|
49
49
|
"vitest": "^4.1.10",
|
|
50
50
|
"zone.js": "^0.16.2",
|
|
51
|
-
"@solar-icons/core": "2.0.0-beta.
|
|
51
|
+
"@solar-icons/core": "2.0.0-beta.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@angular/common": "17.x - 22.x",
|