@kubex/zinc 1.0.25 → 1.0.99
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/.claude/project.md +556 -0
- package/.github/workflows/js_build_and_deploy.yaml +9 -10
- package/dist/custom-elements.json +13575 -8856
- package/dist/vscode.html-custom-data.json +583 -48
- package/dist/web-types.json +1441 -181
- package/dist/zn.d.ts +1645 -660
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1412 -893
- package/docs/_utilities/code-previews.cjs +10 -1
- package/docs/assets/scripts/docs.js +42 -18
- package/docs/data/data-table.json +229 -66
- package/docs/data/empty.json +6 -0
- package/docs/data/products-table.json +41 -193
- package/docs/pages/components/action-bar.md +121 -6
- package/docs/pages/components/alert.md +118 -15
- package/docs/pages/components/animated-button.md +299 -0
- package/docs/pages/components/audio-select.md +534 -0
- package/docs/pages/components/bulk-actions.md +79 -5
- package/docs/pages/components/button-group.md +235 -27
- package/docs/pages/components/button.md +139 -1
- package/docs/pages/components/chart.md +365 -9
- package/docs/pages/components/checkbox.md +387 -58
- package/docs/pages/components/chip.md +253 -33
- package/docs/pages/components/collapsible.md +393 -46
- package/docs/pages/components/cols.md +152 -30
- package/docs/pages/components/confirm.md +182 -16
- package/docs/pages/components/copy-button.md +169 -6
- package/docs/pages/components/data-select.md +194 -15
- package/docs/pages/components/data-table-filter.md +96 -5
- package/docs/pages/components/data-table-search.md +451 -0
- package/docs/pages/components/data-table-sort.md +66 -5
- package/docs/pages/components/data-table.md +727 -66
- package/docs/pages/components/datepicker.md +402 -7
- package/docs/pages/components/defined-label.md +120 -5
- package/docs/pages/components/dialog.md +339 -59
- package/docs/pages/components/dropdown.md +366 -11
- package/docs/pages/components/editor.md +604 -7
- package/docs/pages/components/empty-state.md +315 -16
- package/docs/pages/components/expanding-action.md +212 -28
- package/docs/pages/components/file.md +421 -12
- package/docs/pages/components/filter-container.md +158 -5
- package/docs/pages/components/filter-wrapper.md +167 -6
- package/docs/pages/components/form-group.md +383 -6
- package/docs/pages/components/hover-container.md +237 -6
- package/docs/pages/components/icon-picker.md +121 -0
- package/docs/pages/components/icon.md +454 -48
- package/docs/pages/components/inline-edit.md +787 -19
- package/docs/pages/components/input-group.md +207 -13
- package/docs/pages/components/input.md +194 -0
- package/docs/pages/components/item.md +18 -0
- package/docs/pages/components/key-container.md +115 -0
- package/docs/pages/components/key.md +101 -0
- package/docs/pages/components/menu.md +512 -6
- package/docs/pages/components/note.md +239 -36
- package/docs/pages/components/opt-group.md +107 -0
- package/docs/pages/components/pagination.md +332 -6
- package/docs/pages/components/pane.md +222 -6
- package/docs/pages/components/panel.md +213 -26
- package/docs/pages/components/popup.md +1354 -6
- package/docs/pages/components/priority-list.md +233 -0
- package/docs/pages/components/progress-bar.md +387 -6
- package/docs/pages/components/radio-group.md +242 -5
- package/docs/pages/components/radio.md +474 -6
- package/docs/pages/components/rating.md +331 -7
- package/docs/pages/components/reveal.md +524 -6
- package/docs/pages/components/scroll-container.md +552 -6
- package/docs/pages/components/select.md +762 -160
- package/docs/pages/components/skeleton.md +473 -30
- package/docs/pages/components/slideout.md +261 -5
- package/docs/pages/components/sp.md +99 -41
- package/docs/pages/components/split-button.md +347 -9
- package/docs/pages/components/split-pane.md +445 -6
- package/docs/pages/components/stat.md +549 -9
- package/docs/pages/components/status-indicator.md +230 -1
- package/docs/pages/components/stepper.md +563 -6
- package/docs/pages/components/tabs.md +439 -13
- package/docs/pages/components/textarea.md +415 -17
- package/docs/pages/components/tile.md +385 -26
- package/docs/pages/components/toggle.md +424 -6
- package/docs/pages/components/tooltip.md +367 -0
- package/docs/pages/components/translation-group.md +210 -0
- package/docs/pages/components/translations.md +319 -19
- package/docs/pages/components/vertical-stepper.md +401 -8
- package/docs/pages/components/well.md +300 -3
- package/docs/pages/getting-started/form-controls.md +162 -0
- package/docs/pages/index.md +116 -15
- package/package.json +5 -6
- package/scss/_global-spacing.scss +4 -0
- package/scss/_root.scss +2 -2
- package/scss/boot.scss +19 -0
- package/scss/shared/layout.scss +5 -0
- package/scss/themes/_light.scss +3 -3
- package/src/components/alert/alert.scss +1 -0
- package/src/components/animated-button/README.md +306 -0
- package/src/components/animated-button/animated-button.component.ts +229 -0
- package/src/components/animated-button/animated-button.scss +228 -0
- package/src/components/animated-button/animated-button.test.ts +143 -0
- package/src/components/animated-button/index.ts +12 -0
- package/src/components/button/button.component.ts +5 -0
- package/src/components/button-group/button-group.component.ts +25 -13
- package/src/components/button-group/button-group.scss +6 -0
- package/src/components/checkbox/checkbox.component.ts +4 -0
- package/src/components/checkbox/checkbox.scss +7 -4
- package/src/components/checkbox-group/checkbox-group.scss +7 -0
- package/src/components/chip/chip.component.ts +7 -2
- package/src/components/chip/chip.scss +16 -2
- package/src/components/collapsible/collapsible.component.ts +27 -20
- package/src/components/cols/cols.component.ts +14 -2
- package/src/components/cols/cols.scss +6 -12
- package/src/components/confirm/confirm.component.ts +7 -0
- package/src/components/copy-button/copy-button.component.ts +12 -11
- package/src/components/data-select/data-select.component.ts +215 -44
- package/src/components/data-select/data-select.scss +66 -6
- package/src/components/data-select/providers/currency-data-provider.ts +20 -6
- package/src/components/data-select/providers/provider.ts +1 -0
- package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
- package/src/components/data-table/data-table.component.ts +81 -22
- package/src/components/data-table-search/data-table-search.component.ts +184 -0
- package/src/components/data-table-search/data-table-search.scss +17 -0
- package/src/components/data-table-search/data-table-search.test.ts +11 -0
- package/src/components/data-table-search/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +347 -13
- package/src/components/dialog/dialog.component.ts +1 -1
- package/src/components/empty-state/empty-state.scss +6 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/icon/icon.component.ts +23 -1
- package/src/components/icon/icon.scss +23 -0
- package/src/components/icon-picker/brand-icons.ts +24 -0
- package/src/components/icon-picker/icon-picker.component.ts +407 -0
- package/src/components/icon-picker/icon-picker.scss +205 -0
- package/src/components/icon-picker/index.ts +12 -0
- package/src/components/icon-picker/line-icons.ts +612 -0
- package/src/components/icon-picker/material-icons.ts +14543 -0
- package/src/components/inline-edit/inline-edit.component.ts +190 -46
- package/src/components/inline-edit/inline-edit.scss +29 -0
- package/src/components/inline-edit/inline-edit.test.ts +314 -1
- package/src/components/input/input.component.ts +324 -5
- package/src/components/input/input.scss +87 -0
- package/src/components/input-group/input-group.component.ts +28 -7
- package/src/components/input-group/input-group.scss +48 -10
- package/src/components/item/item.component.ts +24 -3
- package/src/components/item/item.scss +18 -0
- package/src/components/key/index.ts +12 -0
- package/src/components/key/key.component.ts +47 -0
- package/src/components/key/key.scss +38 -0
- package/src/components/key-container/index.ts +12 -0
- package/src/components/key-container/key-container.component.ts +142 -0
- package/src/components/key-container/key-container.scss +33 -0
- package/src/components/menu-item/menu-item.component.ts +20 -0
- package/src/components/menu-item/menu-item.scss +69 -2
- package/src/components/navbar/navbar.component.ts +103 -11
- package/src/components/navbar/navbar.scss +6 -1
- package/src/components/opt-group/index.ts +12 -0
- package/src/components/opt-group/opt-group.component.ts +74 -0
- package/src/components/opt-group/opt-group.scss +37 -0
- package/src/components/opt-group/opt-group.test.ts +27 -0
- package/src/components/option/option.component.ts +1 -16
- package/src/components/option/option.scss +4 -0
- package/src/components/panel/panel.component.ts +10 -8
- package/src/components/panel/panel.scss +20 -0
- package/src/components/priority-list/index.ts +12 -0
- package/src/components/priority-list/priority-list.component.ts +611 -0
- package/src/components/priority-list/priority-list.scss +185 -0
- package/src/components/priority-list/priority-list.test.ts +139 -0
- package/src/components/progress-bar/progress-bar.component.ts +22 -16
- package/src/components/radio/radio.scss +10 -3
- package/src/components/select/select.component.ts +812 -72
- package/src/components/select/select.scss +108 -2
- package/src/components/select/select.test.ts +147 -2
- package/src/components/settings-container/settings-container.component.ts +44 -19
- package/src/components/settings-container/settings-container.scss +1 -1
- package/src/components/skeleton/skeleton.component.ts +6 -1
- package/src/components/slideout/slideout.scss +8 -3
- package/src/components/sp/sp.component.ts +3 -1
- package/src/components/sp/sp.scss +19 -0
- package/src/components/stepper/stepper.component.ts +16 -10
- package/src/components/textarea/textarea.scss +0 -4
- package/src/components/tile/tile.component.ts +12 -3
- package/src/components/tile/tile.scss +1 -1
- package/src/components/timer/timer.component.ts +15 -2
- package/src/components/toggle/toggle.component.ts +29 -26
- package/src/components/toggle/toggle.scss +13 -1
- package/src/components/translation-group/index.ts +12 -0
- package/src/components/translation-group/translation-group.component.ts +207 -0
- package/src/components/translation-group/translation-group.scss +8 -0
- package/src/components/translations/translations.component.ts +90 -44
- package/src/components/translations/translations.scss +4 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
- package/src/events/events.ts +12 -7
- package/src/events/zn-language-change.ts +7 -0
- package/src/events/zn-purchase.ts +11 -0
- package/src/events/zn-redirect.ts +7 -0
- package/src/events/zn-reorder.ts +7 -0
- package/src/events/zn-search-change.ts +11 -0
- package/src/events/zn-submit.ts +1 -1
- package/src/form-control.scss +4 -0
- package/src/internal/form-navigation.ts +510 -0
- package/src/internal/form.ts +6 -0
- package/src/zinc.ts +91 -83
|
@@ -1,21 +1,252 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Icon
|
|
4
|
-
description:
|
|
4
|
+
description: Icons are symbols used to represent actions, objects, or concepts throughout the interface.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
|
-
|
|
10
|
-
<zn-icon src="Add"></zn-icon>
|
|
9
|
+
<zn-icon src="check"></zn-icon>
|
|
11
10
|
```
|
|
12
11
|
|
|
12
|
+
The icon component provides a flexible way to display icons from multiple libraries including Material Icons, Material Symbols, Line Icons, and custom brand icons. It also supports avatar generation, Gravatar, and custom image sources.
|
|
13
|
+
|
|
13
14
|
## Examples
|
|
14
15
|
|
|
15
|
-
###
|
|
16
|
+
### Basic Usage
|
|
17
|
+
|
|
18
|
+
The simplest way to use an icon is by specifying the icon name in the `src` attribute. By default, icons use the Material Symbols Outlined library.
|
|
19
|
+
|
|
20
|
+
```html:preview
|
|
21
|
+
<zn-icon src="home"></zn-icon>
|
|
22
|
+
<zn-icon src="settings"></zn-icon>
|
|
23
|
+
<zn-icon src="favorite"></zn-icon>
|
|
24
|
+
<zn-icon src="shopping_cart"></zn-icon>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Sizes
|
|
28
|
+
|
|
29
|
+
Use the `size` attribute to control the icon's dimensions. The default size is 24 pixels.
|
|
30
|
+
|
|
31
|
+
```html:preview
|
|
32
|
+
<zn-icon src="star" size="16"></zn-icon>
|
|
33
|
+
<zn-icon src="star" size="24"></zn-icon>
|
|
34
|
+
<zn-icon src="star" size="32"></zn-icon>
|
|
35
|
+
<zn-icon src="star" size="48"></zn-icon>
|
|
36
|
+
<zn-icon src="star" size="64"></zn-icon>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Colors
|
|
40
|
+
|
|
41
|
+
Use the `color` attribute to apply semantic or predefined colors to your icons.
|
|
42
|
+
|
|
43
|
+
```html:preview
|
|
44
|
+
<zn-icon src="check_circle" color="default" size="32"></zn-icon>
|
|
45
|
+
<zn-icon src="check_circle" color="primary" size="32"></zn-icon>
|
|
46
|
+
<zn-icon src="check_circle" color="accent" size="32"></zn-icon>
|
|
47
|
+
<zn-icon src="check_circle" color="info" size="32"></zn-icon>
|
|
48
|
+
<zn-icon src="check_circle" color="warning" size="32"></zn-icon>
|
|
49
|
+
<zn-icon src="check_circle" color="error" size="32"></zn-icon>
|
|
50
|
+
<zn-icon src="check_circle" color="success" size="32"></zn-icon>
|
|
51
|
+
<zn-icon src="check_circle" color="disabled" size="32"></zn-icon>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Additional color options are available for specific use cases:
|
|
55
|
+
|
|
56
|
+
```html:preview
|
|
57
|
+
<zn-icon src="palette" color="red" size="32"></zn-icon>
|
|
58
|
+
<zn-icon src="palette" color="blue" size="32"></zn-icon>
|
|
59
|
+
<zn-icon src="palette" color="green" size="32"></zn-icon>
|
|
60
|
+
<zn-icon src="palette" color="orange" size="32"></zn-icon>
|
|
61
|
+
<zn-icon src="palette" color="yellow" size="32"></zn-icon>
|
|
62
|
+
<zn-icon src="palette" color="indigo" size="32"></zn-icon>
|
|
63
|
+
<zn-icon src="palette" color="violet" size="32"></zn-icon>
|
|
64
|
+
<zn-icon src="palette" color="pink" size="32"></zn-icon>
|
|
65
|
+
<zn-icon src="palette" color="grey" size="32"></zn-icon>
|
|
66
|
+
<zn-icon src="palette" color="white" size="32" style="background: #333; padding: 4px;"></zn-icon>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Round Icons
|
|
70
|
+
|
|
71
|
+
Add the `round` attribute to give icons a circular background.
|
|
72
|
+
|
|
73
|
+
```html:preview
|
|
74
|
+
<zn-icon src="person" size="40" color="primary" round></zn-icon>
|
|
75
|
+
<zn-icon src="mail" size="40" color="info" round></zn-icon>
|
|
76
|
+
<zn-icon src="favorite" size="40" color="error" round></zn-icon>
|
|
77
|
+
<zn-icon src="settings" size="40" color="accent" round></zn-icon>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Padded Icons
|
|
81
|
+
|
|
82
|
+
Use the `padded` attribute to add internal spacing around the icon.
|
|
83
|
+
|
|
84
|
+
```html:preview
|
|
85
|
+
<zn-icon src="notifications" size="40" color="warning" padded round></zn-icon>
|
|
86
|
+
<zn-icon src="shopping_cart" size="40" color="success" padded round></zn-icon>
|
|
87
|
+
<zn-icon src="search" size="40" color="info" padded round></zn-icon>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Squared Icons
|
|
91
|
+
|
|
92
|
+
Use the `squared` attribute to maintain a 1:1 aspect ratio for the icon container.
|
|
93
|
+
|
|
94
|
+
```html:preview
|
|
95
|
+
<zn-icon src="dashboard" size="40" color="primary" squared></zn-icon>
|
|
96
|
+
<zn-icon src="analytics" size="40" color="accent" squared></zn-icon>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Blink Animation
|
|
100
|
+
|
|
101
|
+
Add the `blink` attribute to create a blinking effect, useful for notifications or alerts.
|
|
102
|
+
|
|
103
|
+
```html:preview
|
|
104
|
+
<zn-icon src="notification_important" size="32" color="warning" blink></zn-icon>
|
|
105
|
+
<zn-icon src="error" size="32" color="error" blink></zn-icon>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Icon Libraries
|
|
109
|
+
|
|
110
|
+
The icon component supports multiple icon libraries. You can specify the library using the `library` attribute or use shorthand notation with the `@` symbol in the `src` attribute.
|
|
111
|
+
|
|
112
|
+
### Material Symbols Outlined (Default)
|
|
113
|
+
|
|
114
|
+
Material Symbols Outlined is the default library. These icons are modern and versatile.
|
|
115
|
+
|
|
116
|
+
```html:preview
|
|
117
|
+
<zn-icon src="home" size="32"></zn-icon>
|
|
118
|
+
<zn-icon src="account_circle" size="32"></zn-icon>
|
|
119
|
+
<zn-icon src="lightbulb" size="32"></zn-icon>
|
|
120
|
+
<zn-icon src="schedule" size="32"></zn-icon>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Material Icons Variants
|
|
124
|
+
|
|
125
|
+
Material Icons come in several variants: filled, outlined, round, sharp, and two-tone.
|
|
126
|
+
|
|
127
|
+
```html:preview
|
|
128
|
+
<zn-icon src="favorite@material" size="32"></zn-icon>
|
|
129
|
+
<zn-icon src="favorite@material-outlined" size="32"></zn-icon>
|
|
130
|
+
<zn-icon src="favorite@material-round" size="32"></zn-icon>
|
|
131
|
+
<zn-icon src="favorite@material-sharp" size="32"></zn-icon>
|
|
132
|
+
<zn-icon src="favorite@material-two-tone" size="32"></zn-icon>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
You can also use the library attribute directly:
|
|
136
|
+
|
|
137
|
+
```html:preview
|
|
138
|
+
<zn-icon src="star" library="material" size="32"></zn-icon>
|
|
139
|
+
<zn-icon src="star" library="material-outlined" size="32"></zn-icon>
|
|
140
|
+
<zn-icon src="star" library="material-round" size="32"></zn-icon>
|
|
141
|
+
<zn-icon src="star" library="material-sharp" size="32"></zn-icon>
|
|
142
|
+
<zn-icon src="star" library="material-two-tone" size="32"></zn-icon>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### Shorthand Library Notation
|
|
146
|
+
|
|
147
|
+
You can use convenient shorthand notations:
|
|
148
|
+
|
|
149
|
+
- `@m` or `@mat` → material
|
|
150
|
+
- `@mo` → material-outlined
|
|
151
|
+
- `@mr` → material-round
|
|
152
|
+
- `@ms` → material-sharp
|
|
153
|
+
- `@mt` or `@m2` → material-two-tone
|
|
154
|
+
- `@mso` → material-symbols-outlined
|
|
155
|
+
|
|
156
|
+
```html:preview
|
|
157
|
+
<zn-icon src="home@m" size="32"></zn-icon>
|
|
158
|
+
<zn-icon src="home@mo" size="32"></zn-icon>
|
|
159
|
+
<zn-icon src="home@mr" size="32"></zn-icon>
|
|
160
|
+
<zn-icon src="home@ms" size="32"></zn-icon>
|
|
161
|
+
<zn-icon src="home@mt" size="32"></zn-icon>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Line Icons
|
|
165
|
+
|
|
166
|
+
Line Icons provide a collection of modern, consistent icons. Use `library="line"` or the `@line` shorthand.
|
|
167
|
+
|
|
168
|
+
<a href="https://lineicons.com/free-icons" target="_blank">View Line Icons</a>
|
|
169
|
+
|
|
170
|
+
```html:preview
|
|
171
|
+
<zn-icon src="heart" library="line" size="32"></zn-icon>
|
|
172
|
+
<zn-icon src="bookmark-1" library="line" size="32"></zn-icon>
|
|
173
|
+
<zn-icon src="home" library="line" size="32"></zn-icon>
|
|
174
|
+
<zn-icon src="user" library="line" size="32"></zn-icon>
|
|
175
|
+
<zn-icon src="envelope" library="line" size="32"></zn-icon>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Using shorthand notation:
|
|
16
179
|
|
|
17
180
|
```html:preview
|
|
181
|
+
<zn-icon src="rocket@line" size="32"></zn-icon>
|
|
182
|
+
<zn-icon src="cloud-upload@line" size="32"></zn-icon>
|
|
183
|
+
<zn-icon src="star@line" size="32"></zn-icon>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Brand Icons
|
|
187
|
+
|
|
188
|
+
Display brand logos and custom company icons using the brands library.
|
|
189
|
+
|
|
190
|
+
```html:preview
|
|
191
|
+
<style>.icncont{ width:40px; height:40px; background:#efefef; display:inline-flex; align-items: center; justify-content: center; margin:3px;}</style>
|
|
192
|
+
<span class=icncont><zn-icon src="adyen" size="32" library="brands"></zn-icon></span>
|
|
193
|
+
<span class=icncont><zn-icon src="bottomline" size="32" library="brands"></zn-icon></span>
|
|
194
|
+
<span class=icncont><zn-icon src="chargehive" size="32" library="brands"></zn-icon></span>
|
|
195
|
+
<span class=icncont><zn-icon src="checkout" size="32" library="brands"></zn-icon></span>
|
|
196
|
+
<span class=icncont><zn-icon src="clearhaus" size="32" library="brands"></zn-icon></span>
|
|
197
|
+
<span class=icncont><zn-icon src="cwams" size="32" library="brands"></zn-icon></span>
|
|
198
|
+
<span class=icncont><zn-icon src="epx" size="32" library="brands"></zn-icon></span>
|
|
199
|
+
<span class=icncont><zn-icon src="flexpay" size="32" library="brands"></zn-icon></span>
|
|
200
|
+
<span class=icncont><zn-icon src="gpayments" size="32" library="brands"></zn-icon></span>
|
|
201
|
+
<span class=icncont><zn-icon src="kount" size="32" library="brands"></zn-icon></span>
|
|
202
|
+
<span class=icncont><zn-icon src="qualpay" size="32" library="brands"></zn-icon></span>
|
|
203
|
+
<span class=icncont><zn-icon src="recaptcha" size="32" library="brands"></zn-icon></span>
|
|
204
|
+
<span class=icncont><zn-icon src="tokenex" size="32" library="brands"></zn-icon></span>
|
|
205
|
+
<span class=icncont><zn-icon src="trustpayments" size="32" library="brands"></zn-icon></span>
|
|
206
|
+
<span class=icncont><zn-icon src="worldpay" size="32" library="brands"></zn-icon></span>
|
|
207
|
+
<span class=icncont><zn-icon src="yapstone" size="32" library="brands"></zn-icon></span>
|
|
208
|
+
<span class=icncont><zn-icon src="chargie" size="32" library="brands"></zn-icon></span>
|
|
209
|
+
<span class=icncont><zn-icon src="chargie-head" size="32" library="brands"></zn-icon></span>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Custom Images
|
|
213
|
+
|
|
214
|
+
Use custom images by providing a file path or URL in the `src` attribute. When using a path with a forward slash, the icon automatically uses the `src` library mode.
|
|
215
|
+
|
|
216
|
+
```html:preview
|
|
217
|
+
<zn-icon src="https://via.placeholder.com/32" size="32"></zn-icon>
|
|
218
|
+
<zn-icon src="https://via.placeholder.com/48" size="48"></zn-icon>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
You can also explicitly set `library="src"`:
|
|
222
|
+
|
|
223
|
+
```html:preview
|
|
224
|
+
<zn-icon src="https://via.placeholder.com/32" library="src" size="32"></zn-icon>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Avatar Generation
|
|
228
|
+
|
|
229
|
+
The avatar library automatically generates avatar initials with consistent color schemes. Perfect for user profiles and identity representation.
|
|
230
|
+
|
|
231
|
+
#### Basic Avatars
|
|
232
|
+
|
|
233
|
+
```html:preview
|
|
234
|
+
<zn-icon src="John Doe" library="avatar" size="40" round></zn-icon>
|
|
235
|
+
<zn-icon src="Jane Smith" library="avatar" size="40" round></zn-icon>
|
|
236
|
+
<zn-icon src="Bob Wilson" library="avatar" size="40" round></zn-icon>
|
|
237
|
+
<zn-icon src="Alice Johnson" library="avatar" size="40" round></zn-icon>
|
|
238
|
+
<zn-icon src="Mike Brown" library="avatar" size="40" round></zn-icon>
|
|
239
|
+
```
|
|
18
240
|
|
|
241
|
+
The avatar automatically extracts initials intelligently:
|
|
242
|
+
|
|
243
|
+
- First letter of first word + first letter of any capital letter or word boundary
|
|
244
|
+
- Supports camelCase (e.g., "ThankYou" → "TY")
|
|
245
|
+
- Supports space-separated names (e.g., "John Doe" → "JD")
|
|
246
|
+
|
|
247
|
+
#### Alphabet Display
|
|
248
|
+
|
|
249
|
+
```html:preview
|
|
19
250
|
<zn-icon src="A" size=32 library="avatar" round></zn-icon>
|
|
20
251
|
<zn-icon src="B" size=32 library="avatar" round></zn-icon>
|
|
21
252
|
<zn-icon src="C" size=32 library="avatar" round></zn-icon>
|
|
@@ -42,76 +273,251 @@ layout: component
|
|
|
42
273
|
<zn-icon src="X" size=32 library="avatar" round></zn-icon>
|
|
43
274
|
<zn-icon src="Y" size=32 library="avatar" round></zn-icon>
|
|
44
275
|
<zn-icon src="Z" size=32 library="avatar" round></zn-icon>
|
|
45
|
-
<zn-icon src="0" size=32 library="avatar" round></zn-icon>
|
|
46
|
-
<zn-icon src="RV" size=32 library="avatar" round></zn-icon>
|
|
47
|
-
<zn-icon src="RV" size=32 library="avatar" color="primary"></zn-icon>
|
|
48
|
-
<zn-icon src="BG" size=32 library="avatar" color="accent" round></zn-icon>
|
|
49
|
-
<zn-icon src="Random Name" size=32 library="avatar" color="error" round></zn-icon>
|
|
50
|
-
<zn-icon src="ThankYou" size=32 library="avatar" color="success" round></zn-icon>
|
|
51
|
-
<zn-icon src="What NeXt" size=32 library="avatar" color="warning" round></zn-icon>
|
|
52
276
|
```
|
|
53
277
|
|
|
54
|
-
|
|
278
|
+
#### Avatars with Colors
|
|
279
|
+
|
|
280
|
+
Override the automatic color generation by specifying a `color` attribute:
|
|
55
281
|
|
|
56
282
|
```html:preview
|
|
283
|
+
<zn-icon src="RV" size="40" library="avatar" round></zn-icon>
|
|
284
|
+
<zn-icon src="RV" size="40" library="avatar" color="primary"></zn-icon>
|
|
285
|
+
<zn-icon src="BG" size="40" library="avatar" color="accent" round></zn-icon>
|
|
286
|
+
<zn-icon src="Random Name" size="40" library="avatar" color="error" round></zn-icon>
|
|
287
|
+
<zn-icon src="ThankYou" size="40" library="avatar" color="success" round></zn-icon>
|
|
288
|
+
<zn-icon src="What NeXt" size="40" library="avatar" color="warning" round></zn-icon>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### Avatar Shapes
|
|
57
292
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<zn-icon src="
|
|
62
|
-
<zn-icon src="
|
|
63
|
-
<zn-icon src="
|
|
64
|
-
<zn-icon src="check" color="success" size="32"></zn-icon>
|
|
65
|
-
<zn-icon src="check" color="white" size="32"></zn-icon>
|
|
293
|
+
Avatars work with or without the `round` attribute:
|
|
294
|
+
|
|
295
|
+
```html:preview
|
|
296
|
+
<zn-icon src="Square Avatar" size="40" library="avatar"></zn-icon>
|
|
297
|
+
<zn-icon src="Round Avatar" size="40" library="avatar" round></zn-icon>
|
|
298
|
+
<zn-icon src="Padded Avatar" size="48" library="avatar" round padded></zn-icon>
|
|
66
299
|
```
|
|
67
300
|
|
|
68
|
-
|
|
301
|
+
Using shorthand notation:
|
|
69
302
|
|
|
70
303
|
```html:preview
|
|
304
|
+
<zn-icon src="John Doe@avatar" size="40" round></zn-icon>
|
|
305
|
+
<zn-icon src="Jane Smith@av" size="40" round></zn-icon>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Gravatar
|
|
71
309
|
|
|
72
|
-
|
|
310
|
+
Gravatar provides globally recognized avatars based on email addresses. Simply provide an email address as the `src` and the component will automatically detect it and use Gravatar.
|
|
311
|
+
|
|
312
|
+
```html:preview
|
|
313
|
+
<zn-icon src="test1@example.com" size="48" round></zn-icon>
|
|
314
|
+
<zn-icon src="user@example.com" size="48" round></zn-icon>
|
|
315
|
+
<zn-icon src="hello@example.com" size="48" round></zn-icon>
|
|
73
316
|
```
|
|
74
317
|
|
|
75
|
-
|
|
318
|
+
#### Gravatar with Fallback
|
|
319
|
+
|
|
320
|
+
You can specify a fallback image type using the `#` symbol followed by the fallback type:
|
|
76
321
|
|
|
77
322
|
```html:preview
|
|
78
|
-
<zn-icon src="
|
|
323
|
+
<zn-icon src="nonexistent@example.com#identicon" size="48" round></zn-icon>
|
|
324
|
+
<zn-icon src="nonexistent@example.com#monsterid" size="48" round></zn-icon>
|
|
325
|
+
<zn-icon src="nonexistent@example.com#wavatar" size="48" round></zn-icon>
|
|
326
|
+
<zn-icon src="nonexistent@example.com#retro" size="48" round></zn-icon>
|
|
327
|
+
<zn-icon src="nonexistent@example.com#robohash" size="48" round></zn-icon>
|
|
79
328
|
```
|
|
80
329
|
|
|
81
|
-
|
|
330
|
+
Explicit library specification:
|
|
82
331
|
|
|
83
|
-
|
|
332
|
+
```html:preview
|
|
333
|
+
<zn-icon src="test1@example.com" library="gravatar" size="48"></zn-icon>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Using shorthand notation:
|
|
84
337
|
|
|
85
338
|
```html:preview
|
|
339
|
+
<zn-icon src="test1@example.com@grav" size="48" round></zn-icon>
|
|
340
|
+
```
|
|
86
341
|
|
|
87
|
-
|
|
342
|
+
### Libravatar
|
|
343
|
+
|
|
344
|
+
Libravatar is an open-source alternative to Gravatar. Use it for federated avatar services.
|
|
345
|
+
|
|
346
|
+
```html:preview
|
|
347
|
+
<zn-icon src="test1@example.com" library="libravatar" size="48" round></zn-icon>
|
|
348
|
+
<zn-icon src="user@example.com" library="libravatar" size="48" round></zn-icon>
|
|
88
349
|
```
|
|
89
350
|
|
|
90
|
-
|
|
351
|
+
Similar to Gravatar, you can specify fallback options:
|
|
91
352
|
|
|
92
353
|
```html:preview
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
354
|
+
<zn-icon src="nonexistent@example.com#identicon" library="libravatar" size="48" round></zn-icon>
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## Advanced Features
|
|
358
|
+
|
|
359
|
+
### Alt Text for Accessibility
|
|
360
|
+
|
|
361
|
+
Use the `alt` attribute to provide alternative text for image-based icons (custom images, Gravatar, Libravatar).
|
|
362
|
+
|
|
363
|
+
```html:preview
|
|
364
|
+
<zn-icon src="https://via.placeholder.com/32" alt="Placeholder image" size="32"></zn-icon>
|
|
365
|
+
<zn-icon src="user@example.com" alt="User avatar" size="32" round></zn-icon>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Special Syntax
|
|
369
|
+
|
|
370
|
+
The icon component supports special syntax in the `src` attribute for quick configuration.
|
|
371
|
+
|
|
372
|
+
#### Hash Symbol (#) for Modifiers
|
|
373
|
+
|
|
374
|
+
Add modifiers after a `#` symbol:
|
|
375
|
+
|
|
376
|
+
```html:preview
|
|
377
|
+
<zn-icon src="star#round" size="32" color="warning"></zn-icon>
|
|
378
|
+
<zn-icon src="favorite#round" size="32" color="error"></zn-icon>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
#### At Symbol (@) for Library Selection
|
|
382
|
+
|
|
383
|
+
Quickly specify the library using `@`:
|
|
384
|
+
|
|
385
|
+
```html:preview
|
|
386
|
+
<zn-icon src="home@material" size="32"></zn-icon>
|
|
387
|
+
<zn-icon src="star@line" size="32"></zn-icon>
|
|
388
|
+
<zn-icon src="John Doe@avatar" size="40" round></zn-icon>
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Combined with modifiers:
|
|
392
|
+
|
|
393
|
+
```html:preview
|
|
394
|
+
<zn-icon src="favorite@material#round" size="32" color="error"></zn-icon>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Slotted Content
|
|
398
|
+
|
|
399
|
+
When no `src` is provided and no `library` is specified, you can use the default slot to insert custom content:
|
|
400
|
+
|
|
401
|
+
```html:preview
|
|
402
|
+
<zn-icon size="32" style="color: var(--zn-color-primary);">
|
|
403
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
404
|
+
<path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z"/>
|
|
405
|
+
</svg>
|
|
406
|
+
</zn-icon>
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### CSS Custom Properties
|
|
410
|
+
|
|
411
|
+
The icon component exposes CSS custom properties for advanced styling:
|
|
412
|
+
|
|
413
|
+
- `--icon-size`: Controls the icon dimensions (default: 24px)
|
|
414
|
+
- `--icon-color`: Controls the icon color (default: inherit)
|
|
415
|
+
|
|
416
|
+
```html:preview
|
|
417
|
+
<zn-icon src="settings" style="--icon-size: 48px; --icon-color: #ff5722;"></zn-icon>
|
|
418
|
+
<zn-icon src="home" style="--icon-size: 32px; --icon-color: #3f51b5;"></zn-icon>
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### CSS Parts
|
|
422
|
+
|
|
423
|
+
The icon component exposes the `icon` part for styling the internal icon element:
|
|
424
|
+
|
|
425
|
+
```html:preview
|
|
426
|
+
<style>
|
|
427
|
+
.custom-icon::part(icon) {
|
|
428
|
+
filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
|
|
429
|
+
}
|
|
430
|
+
</style>
|
|
431
|
+
<zn-icon class="custom-icon" src="star" size="48" color="warning"></zn-icon>
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Use Cases
|
|
435
|
+
|
|
436
|
+
### In Buttons
|
|
437
|
+
|
|
438
|
+
Icons are commonly used within buttons to provide visual context:
|
|
439
|
+
|
|
440
|
+
```html:preview
|
|
441
|
+
<zn-button icon="add">Add Item</zn-button>
|
|
442
|
+
<zn-button icon="delete" color="error">Delete</zn-button>
|
|
443
|
+
<zn-button icon="edit" color="info">Edit</zn-button>
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### In Navigation
|
|
447
|
+
|
|
448
|
+
Use icons to enhance navigation items:
|
|
449
|
+
|
|
450
|
+
```html:preview
|
|
451
|
+
<zn-menu style="max-width: 200px;">
|
|
452
|
+
<zn-menu-item>
|
|
453
|
+
<zn-icon src="home" slot="prefix" size="20"></zn-icon>
|
|
454
|
+
Home
|
|
455
|
+
</zn-menu-item>
|
|
456
|
+
<zn-menu-item>
|
|
457
|
+
<zn-icon src="settings" slot="prefix" size="20"></zn-icon>
|
|
458
|
+
Settings
|
|
459
|
+
</zn-menu-item>
|
|
460
|
+
<zn-menu-item>
|
|
461
|
+
<zn-icon src="person" slot="prefix" size="20"></zn-icon>
|
|
462
|
+
Profile
|
|
463
|
+
</zn-menu-item>
|
|
464
|
+
</zn-menu>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Status Indicators
|
|
468
|
+
|
|
469
|
+
Combine icons with colors to show status:
|
|
470
|
+
|
|
471
|
+
```html:preview
|
|
472
|
+
<div style="display: flex; gap: 1rem; align-items: center;">
|
|
473
|
+
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
474
|
+
<zn-icon src="check_circle" color="success" size="20"></zn-icon>
|
|
475
|
+
<span>Active</span>
|
|
476
|
+
</div>
|
|
477
|
+
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
478
|
+
<zn-icon src="error" color="error" size="20"></zn-icon>
|
|
479
|
+
<span>Error</span>
|
|
480
|
+
</div>
|
|
481
|
+
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
482
|
+
<zn-icon src="warning" color="warning" size="20"></zn-icon>
|
|
483
|
+
<span>Warning</span>
|
|
484
|
+
</div>
|
|
485
|
+
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
486
|
+
<zn-icon src="info" color="info" size="20"></zn-icon>
|
|
487
|
+
<span>Info</span>
|
|
488
|
+
</div>
|
|
489
|
+
</div>
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### User Avatars in Lists
|
|
493
|
+
|
|
494
|
+
```html:preview
|
|
495
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
496
|
+
<div style="display: flex; align-items: center; gap: 0.75rem;">
|
|
497
|
+
<zn-icon src="John Smith@avatar" size="40" round></zn-icon>
|
|
498
|
+
<div>
|
|
499
|
+
<div style="font-weight: 600;">John Smith</div>
|
|
500
|
+
<div style="font-size: 0.875rem; color: #666;">john.smith@example.com</div>
|
|
501
|
+
</div>
|
|
502
|
+
</div>
|
|
503
|
+
<div style="display: flex; align-items: center; gap: 0.75rem;">
|
|
504
|
+
<zn-icon src="Sarah Connor@avatar" size="40" round></zn-icon>
|
|
505
|
+
<div>
|
|
506
|
+
<div style="font-weight: 600;">Sarah Connor</div>
|
|
507
|
+
<div style="font-size: 0.875rem; color: #666;">sarah.connor@example.com</div>
|
|
508
|
+
</div>
|
|
509
|
+
</div>
|
|
510
|
+
<div style="display: flex; align-items: center; gap: 0.75rem;">
|
|
511
|
+
<zn-icon src="Mike Johnson@avatar" size="40" round></zn-icon>
|
|
512
|
+
<div>
|
|
513
|
+
<div style="font-weight: 600;">Mike Johnson</div>
|
|
514
|
+
<div style="font-size: 0.875rem; color: #666;">mike.johnson@example.com</div>
|
|
515
|
+
</div>
|
|
516
|
+
</div>
|
|
517
|
+
</div>
|
|
112
518
|
```
|
|
113
519
|
|
|
114
|
-
##
|
|
520
|
+
## Material Icons Reference
|
|
115
521
|
|
|
116
522
|
Our icons are taken directly from Material Icons. Click or tap on any icon to copy its name, then you can use it in
|
|
117
523
|
your HTML like this:
|