@startupjs-ui/icon 0.1.13 → 0.1.19
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/CHANGELOG.md +19 -0
- package/README.mdx +16 -20
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.1.19](https://github.com/startupjs/startupjs-ui/compare/v0.1.18...v0.1.19) (2026-03-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **docs:** don't load all icons to keep bundle small ([#17](https://github.com/startupjs/startupjs-ui/issues/17)) ([d7eb70b](https://github.com/startupjs/startupjs-ui/commit/d7eb70bc11f5b15923f2e43b7ef1f86ea066494e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.1.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @startupjs-ui/icon
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.1.13](https://github.com/startupjs/startupjs-ui/compare/v0.1.12...v0.1.13) (2026-02-03)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @startupjs-ui/icon
|
package/README.mdx
CHANGED
|
@@ -3,11 +3,9 @@ import Icon, { _PropsJsonSchema as IconPropsJsonSchema } from './index'
|
|
|
3
3
|
import Div from '@startupjs-ui/div'
|
|
4
4
|
import Br from '@startupjs-ui/br'
|
|
5
5
|
import TextInput from '@startupjs-ui/text-input'
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
faShareAlt
|
|
10
|
-
} from '@fortawesome/free-solid-svg-icons'
|
|
6
|
+
import { faHouseUser } from '@fortawesome/free-solid-svg-icons/faHouseUser'
|
|
7
|
+
import { faTable } from '@fortawesome/free-solid-svg-icons/faTable'
|
|
8
|
+
import { faShareAlt } from '@fortawesome/free-solid-svg-icons/faShareAlt'
|
|
11
9
|
import CustomIconExample from './CustomIconExample.svg'
|
|
12
10
|
import { Sandbox } from '@startupjs-ui/docs'
|
|
13
11
|
import './index.mdx.cssx.styl'
|
|
@@ -16,16 +14,18 @@ import './index.mdx.cssx.styl'
|
|
|
16
14
|
|
|
17
15
|
Icons are visual symbols used to represent ideas, objects, or actions. They communicate messages at a glance, afford interactivity, and draw attention to important information.
|
|
18
16
|
|
|
17
|
+
The `icon` prop accepts a FontAwesome icon definition, a custom SVG component, or a registered icon name. You can apply custom `style` to control the icon's appearance (including color).
|
|
18
|
+
|
|
19
19
|
```jsx
|
|
20
20
|
import { Icon } from 'startupjs-ui'
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Simple example
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The component uses the `@fortawesome/react-native-fontawesome` library for rendering icons.
|
|
26
26
|
|
|
27
27
|
```jsx
|
|
28
|
-
import { faHouseUser } from '@fortawesome/free-solid-svg-icons'
|
|
28
|
+
import { faHouseUser } from '@fortawesome/free-solid-svg-icons/faHouseUser'
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
```jsx example
|
|
@@ -36,7 +36,7 @@ return (
|
|
|
36
36
|
|
|
37
37
|
## Custom Icon
|
|
38
38
|
|
|
39
|
-
To use
|
|
39
|
+
To use a custom icon, pass a valid SVG component to the `icon` prop.
|
|
40
40
|
|
|
41
41
|
```jsx
|
|
42
42
|
import CustomIconExample from './CustomIconExample.svg'
|
|
@@ -54,14 +54,12 @@ return (
|
|
|
54
54
|
|
|
55
55
|
## Sizes
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
The `size` prop controls the icon dimensions. It defaults to `'m'`. Predefined size presets are `'xs'`, `'s'`, `'m'`, `'l'`, `'xl'`, and `'xxl'`. You can also pass a number for an arbitrary pixel size. For custom SVG icons, you can set different width and height values using `style`.
|
|
58
58
|
|
|
59
59
|
```jsx
|
|
60
|
-
import {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
faShareAlt
|
|
64
|
-
} from '@fortawesome/free-solid-svg-icons'
|
|
60
|
+
import { faHouseUser } from '@fortawesome/free-solid-svg-icons/faHouseUser'
|
|
61
|
+
import { faTable } from '@fortawesome/free-solid-svg-icons/faTable'
|
|
62
|
+
import { faShareAlt } from '@fortawesome/free-solid-svg-icons/faShareAlt'
|
|
65
63
|
import CustomIconExample from './CustomIconExample.svg'
|
|
66
64
|
```
|
|
67
65
|
|
|
@@ -92,7 +90,7 @@ return (
|
|
|
92
90
|
|
|
93
91
|
## Colors
|
|
94
92
|
|
|
95
|
-
|
|
93
|
+
Set the icon color by specifying `color` in the stylesheet.
|
|
96
94
|
|
|
97
95
|
In `.styl` file
|
|
98
96
|
```stylus
|
|
@@ -108,11 +106,9 @@ In `.styl` file
|
|
|
108
106
|
```
|
|
109
107
|
|
|
110
108
|
```jsx
|
|
111
|
-
import {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
faShareAlt
|
|
115
|
-
} from '@fortawesome/free-solid-svg-icons'
|
|
109
|
+
import { faHouseUser } from '@fortawesome/free-solid-svg-icons/faHouseUser'
|
|
110
|
+
import { faTable } from '@fortawesome/free-solid-svg-icons/faTable'
|
|
111
|
+
import { faShareAlt } from '@fortawesome/free-solid-svg-icons/faShareAlt'
|
|
116
112
|
```
|
|
117
113
|
|
|
118
114
|
```jsx example
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/icon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"@fortawesome/fontawesome-svg-core": "^1.2.26",
|
|
16
16
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
17
17
|
"@fortawesome/react-native-fontawesome": "^0.3.0",
|
|
18
|
-
"@startupjs-ui/core": "^0.1.
|
|
18
|
+
"@startupjs-ui/core": "^0.1.19"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "*",
|
|
22
22
|
"react-native": "*",
|
|
23
23
|
"startupjs": "*"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "bfcca786dc363f42a09b6eef4feb7ca8139302fc"
|
|
26
26
|
}
|