@startupjs-ui/drawer 0.1.11 → 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 +16 -7
- package/package.json +3 -3
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/drawer
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.1.11](https://github.com/startupjs/startupjs-ui/compare/v0.1.10...v0.1.11) (2026-01-20)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @startupjs-ui/drawer
|
package/README.mdx
CHANGED
|
@@ -8,15 +8,17 @@ import Button from '@startupjs-ui/button'
|
|
|
8
8
|
|
|
9
9
|
# Drawer
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
A sliding panel that appears from the edge of the screen, commonly used for navigation menus or supplementary content. The drawer slides in with an animated transition and can be dismissed by tapping the overlay or swiping it away.
|
|
12
|
+
|
|
13
|
+
You can pass custom `style` to the drawer container and provide content as `children`. The `visible` prop (defaults to `false`) controls whether the drawer is open, and `onDismiss` is called when the drawer finishes its closing animation. The `onRequestOpen` callback fires after the drawer finishes its opening animation. The drawer renders inside a Portal, so you can use `AreaComponent` (defaults to `SafeAreaView`) and `ContentComponent` (defaults to `View`) to customize the wrapper components.
|
|
14
|
+
|
|
13
15
|
```jsx
|
|
14
16
|
import { Drawer } from 'startupjs-ui'
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
## Initialization
|
|
18
20
|
|
|
19
|
-
Before
|
|
21
|
+
Before using Drawer, you need to configure [Portal](/docs/components/Portal).
|
|
20
22
|
|
|
21
23
|
## Simple example
|
|
22
24
|
```jsx example
|
|
@@ -42,7 +44,9 @@ return (
|
|
|
42
44
|
```
|
|
43
45
|
|
|
44
46
|
## Position
|
|
45
|
-
|
|
47
|
+
|
|
48
|
+
The drawer can slide in from any edge of the screen: `'left'` (default), `'right'`, `'top'`, or `'bottom'`. Use the `position` prop to control this.
|
|
49
|
+
|
|
46
50
|
```jsx example
|
|
47
51
|
const [visible, setVisible] = useState('')
|
|
48
52
|
|
|
@@ -92,7 +96,9 @@ return (
|
|
|
92
96
|
```
|
|
93
97
|
|
|
94
98
|
## Swipe
|
|
95
|
-
|
|
99
|
+
|
|
100
|
+
The drawer supports swipe-to-close gestures by default (`isSwipe` defaults to `true`). A visible swipe responder zone is shown when `showResponder` is `true` (the default). You can also use the `hasOverlay` prop (defaults to `true`) to control whether a dimming overlay appears behind the drawer. Use `swipeStyle` to customize the appearance and position of the swipe responder zone.
|
|
101
|
+
|
|
96
102
|
```jsx example
|
|
97
103
|
const [visible, setVisible] = useState('')
|
|
98
104
|
|
|
@@ -124,8 +130,11 @@ return (
|
|
|
124
130
|
```
|
|
125
131
|
|
|
126
132
|
## Hook for smooth closing
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
|
|
134
|
+
When actions inside the drawer need to trigger navigation or open another drawer, you want the current drawer to close smoothly with its animation before the next action runs. The `useDrawerDismiss` hook handles this by letting you define named actions that execute only after the dismiss animation completes.
|
|
135
|
+
|
|
136
|
+
Pass `useDrawerDismiss` an object where each key is an action name mapped to a function, plus a `default` key for the standard dismiss behavior. It returns `[onDismiss, setOnDismiss]` -- pass `onDismiss` to the Drawer, and call `setOnDismiss(actionName, ...args)` to trigger a specific action after the drawer closes.
|
|
137
|
+
|
|
129
138
|
```jsx
|
|
130
139
|
import { useDrawerDismiss } from 'startupjs-ui'
|
|
131
140
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/drawer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@startupjs-ui/core": "^0.1.11",
|
|
12
|
-
"@startupjs-ui/portal": "^0.1.
|
|
12
|
+
"@startupjs-ui/portal": "^0.1.16"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "*",
|
|
16
16
|
"react-native": "*",
|
|
17
17
|
"startupjs": "*"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
|
|
20
20
|
}
|