You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/types.ts
+36-13Lines changed: 36 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,23 @@
1
1
exporttypeSnapPointProps={
2
-
/** The height of the sticky footer, if there's one */
2
+
/**
3
+
* The height of the sticky header, if there's one
4
+
*/
3
5
headerHeight: number
4
-
/** The height of the sticky footer, if there's one */
6
+
/**
7
+
* The height of the sticky footer, if there's one
8
+
*/
5
9
footerHeight: number
6
-
/** If the bottom sheet is animating to a snap point the height will match the destination height, not the height the bottom sheet might have in the middle of the animation. It includes the header and footer heights. */
10
+
/**
11
+
* If the bottom sheet is animating to a snap point the height will match the destination height, not the height the bottom sheet might have in the middle of the animation. It includes the header and footer heights.
12
+
*/
7
13
height: number
8
-
/** Minimum height needed to avoid scroll overflow in the content area, if possible. */
14
+
/**
15
+
* Minimum height needed to avoid scroll overflow in the content area, if possible.
16
+
*/
9
17
minHeight: number
10
-
/** Max height the sheet can be, your snap points are capped to this value. It's window.innerHeight by default but can be overriden using the maxHeight prop. */
18
+
/**
19
+
* Max height the sheet can be, your snap points are capped to this value. It's window.innerHeight by default but can be overriden using the maxHeight prop.
20
+
*/
11
21
maxHeight: number
12
22
}
13
23
@@ -20,14 +30,15 @@ export type defaultSnapProps = {
20
30
lastSnap: number|null
21
31
}&SnapPointProps
22
32
23
-
typedefaultSnap=(props: defaultSnapProps)=>number
24
-
25
33
/* Might make sense to expose a preventDefault method here */
26
34
exporttypeSpringEvent={
27
35
type: 'OPEN'|'CLOSE'|'RESIZE'|'SNAP'
28
36
}
29
37
30
38
exporttypeProps={
39
+
/**
40
+
* Ensure that whatever you put in here have at least 1px height, or else the bottom sheet won't open
41
+
*/
31
42
children: React.ReactNode
32
43
33
44
/**
@@ -69,6 +80,7 @@ export type Props = {
69
80
70
81
/**
71
82
* Renders below the drag handle, set to `false` to disable the drag handle
83
+
* @default true
72
84
*/
73
85
header?: React.ReactNode|false
74
86
@@ -99,24 +111,35 @@ export type Props = {
99
111
*/
100
112
scrollLocking?: boolean
101
113
102
-
/** Handler that is called to get the height values that the bottom sheet can *snap* to when the user stops dragging. */
114
+
/**
115
+
* Handler that is called to get the height values that the bottom sheet can *snap* to when the user stops dragging.
116
+
* @default ({ minHeight }) => minHeight
117
+
*/
103
118
snapPoints?: snapPoints
104
119
105
-
/** Handler that is called to get the initial height of the bottom sheet when it's opened (or when the viewport is resized). */
106
-
defaultSnap?: defaultSnap|number
120
+
/**
121
+
* Handler that is called to get the initial height of the bottom sheet when it's opened (or when the viewport is resized).
/* Configures body-scroll-lock to reserve scrollbar gap by setting padding on <body>, clears when closing the bottom sheet. on by default iff blocking=true */
126
+
/**
127
+
* Configures body-scroll-lock to reserve scrollbar gap by setting padding on <body>, clears when closing the bottom sheet.
128
+
* If blocking is true, then reserveScrollBarGap is true by default
129
+
* @default blocking === true
130
+
*/
109
131
reserveScrollBarGap?: boolean
110
132
111
-
/* Open immediatly instead of initially animating from a closed => open state, useful if the bottom sheet is visible by default and the animation would be distracting */
133
+
/**
134
+
* Open immediatly instead of initially animating from a closed => open state, useful if the bottom sheet is visible by default and the animation would be distracting
0 commit comments