@startupjs-ui/menu 0.1.13 → 0.1.16
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 +8 -0
- package/README.mdx +15 -7
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/menu
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.1.13](https://github.com/startupjs/startupjs-ui/compare/v0.1.12...v0.1.13) (2026-02-03)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @startupjs-ui/menu
|
package/README.mdx
CHANGED
|
@@ -11,7 +11,9 @@ import { Sandbox } from '@startupjs-ui/docs'
|
|
|
11
11
|
|
|
12
12
|
Inherits [Div props](/docs/components/Div).
|
|
13
13
|
|
|
14
|
-
Menu displays a list of choices
|
|
14
|
+
Menu displays a list of choices on screen. It can be used for navigation, selecting options, or organizing actions into a vertical or horizontal list.
|
|
15
|
+
|
|
16
|
+
Each item in the menu is a `Menu.Item`. Items can be marked as active, display icons, act as navigation links, and be styled with custom colors.
|
|
15
17
|
|
|
16
18
|
```jsx
|
|
17
19
|
import { Menu } from 'startupjs-ui'
|
|
@@ -19,6 +21,8 @@ import { Menu } from 'startupjs-ui'
|
|
|
19
21
|
|
|
20
22
|
## Simple example
|
|
21
23
|
|
|
24
|
+
At its simplest, a Menu contains a set of `Menu.Item` children. Track which item is active using component state and the `active` prop.
|
|
25
|
+
|
|
22
26
|
```jsx example
|
|
23
27
|
const [active, setActive] = useState('option-1')
|
|
24
28
|
return (
|
|
@@ -41,7 +45,7 @@ return (
|
|
|
41
45
|
|
|
42
46
|
## Highlighted active item
|
|
43
47
|
|
|
44
|
-
By default the active menu item
|
|
48
|
+
By default, the active menu item has no visible border highlight. Use the `activeBorder` prop on the `Menu` component to add a colored border to whichever item is currently active. Supported positions are `'top'`, `'bottom'`, `'left'`, and `'right'`.
|
|
45
49
|
|
|
46
50
|
```jsx example
|
|
47
51
|
const [active, setActive] = useState('option-1')
|
|
@@ -71,7 +75,7 @@ return (
|
|
|
71
75
|
|
|
72
76
|
## Horizontal menu
|
|
73
77
|
|
|
74
|
-
By default the menu
|
|
78
|
+
By default, the menu is laid out vertically. Set `variant='horizontal'` to arrange items in a row instead.
|
|
75
79
|
|
|
76
80
|
```jsx example
|
|
77
81
|
const [active, setActive] = useState('option-1')
|
|
@@ -101,7 +105,7 @@ return (
|
|
|
101
105
|
|
|
102
106
|
## Menu item icon
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
Pass the `icon` prop to a `Menu.Item` to display an icon alongside its label. The icon position defaults to `'left'` but can be changed by setting `iconPosition` on the `Menu` (which applies to all items) or on an individual `Menu.Item` (which overrides the parent setting).
|
|
105
109
|
|
|
106
110
|
```jsx example
|
|
107
111
|
const [active, setActive] = useState('option-1')
|
|
@@ -134,7 +138,11 @@ return (
|
|
|
134
138
|
|
|
135
139
|
## Change color of active item
|
|
136
140
|
|
|
137
|
-
By default, the active menu item
|
|
141
|
+
By default, the active menu item uses the `primary` theme color. Use the `activeColor` prop to apply a custom color to the active item's text, icon, and border. It accepts any valid CSS color value (e.g. `'red'`, `'#fff'`, `'rgb(123, 23, 122)'`).
|
|
142
|
+
|
|
143
|
+
You can also use the `color` prop on individual `Menu.Item` components to override the default text and icon color for inactive items.
|
|
144
|
+
|
|
145
|
+
To render item text in bold, pass the `bold` prop to `Menu.Item`.
|
|
138
146
|
|
|
139
147
|
```jsx example
|
|
140
148
|
const [active, setActive] = useState('option-1')
|
|
@@ -171,7 +179,7 @@ return (
|
|
|
171
179
|
|
|
172
180
|
## Menu item as link
|
|
173
181
|
|
|
174
|
-
|
|
182
|
+
Use the `to` prop on `Menu.Item` to turn it into a navigation link. This is useful for building navigation menus where each item routes to a different page.
|
|
175
183
|
|
|
176
184
|
```jsx example
|
|
177
185
|
const { usePathname } = useRouter()
|
|
@@ -195,7 +203,7 @@ return pug`
|
|
|
195
203
|
|
|
196
204
|
## Complex interaction (integration with other components)
|
|
197
205
|
|
|
198
|
-
|
|
206
|
+
This example shows a collapsible menu with nested submenus, built by combining Menu with the Collapse component. You can pass custom `style` and `containerStyle` props to fine-tune the layout.
|
|
199
207
|
|
|
200
208
|
```jsx example
|
|
201
209
|
const [showMenu, setShowMenu] = useState(true)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/menu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@startupjs-ui/core": "^0.1.11",
|
|
12
|
-
"@startupjs-ui/div": "^0.1.
|
|
13
|
-
"@startupjs-ui/icon": "^0.1.
|
|
14
|
-
"@startupjs-ui/item": "^0.1.
|
|
15
|
-
"@startupjs-ui/span": "^0.1.
|
|
12
|
+
"@startupjs-ui/div": "^0.1.16",
|
|
13
|
+
"@startupjs-ui/icon": "^0.1.16",
|
|
14
|
+
"@startupjs-ui/item": "^0.1.16",
|
|
15
|
+
"@startupjs-ui/span": "^0.1.16"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": "*",
|
|
19
19
|
"react-native": "*",
|
|
20
20
|
"startupjs": "*"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
|
|
23
23
|
}
|