@databricks/appkit 0.3.0 → 0.4.0
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.md +121 -1231
- package/NOTICE.md +1 -1
- package/bin/appkit.js +3 -0
- package/dist/appkit/package.js +1 -1
- package/dist/cache/index.js +3 -3
- package/dist/cache/index.js.map +1 -1
- package/dist/cli/commands/docs.js +47 -0
- package/dist/cli/commands/docs.js.map +1 -0
- package/dist/cli/commands/generate-types.js +38 -0
- package/dist/cli/commands/generate-types.js.map +1 -0
- package/dist/cli/commands/lint.js +104 -0
- package/dist/cli/commands/lint.js.map +1 -0
- package/dist/cli/commands/setup.js +121 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +24 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/plugin.d.ts +1 -0
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +1 -0
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/server/remote-tunnel/remote-tunnel-manager.js +9 -9
- package/dist/server/remote-tunnel/remote-tunnel-manager.js.map +1 -1
- package/dist/server/utils.js +6 -6
- package/dist/server/utils.js.map +1 -1
- package/dist/shared/src/execute.d.ts +1 -0
- package/dist/shared/src/execute.d.ts.map +1 -1
- package/dist/shared/src/plugin.d.ts +3 -0
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/dist/telemetry/types.d.ts +1 -0
- package/dist/telemetry/types.d.ts.map +1 -1
- package/dist/type-generator/index.js +1 -1
- package/dist/type-generator/index.js.map +1 -1
- package/docs/docs/api/appkit/Class.AppKitError/index.html +77 -0
- package/docs/docs/api/appkit/Class.AppKitError.md +154 -0
- package/docs/docs/api/appkit/Class.AuthenticationError/index.html +110 -0
- package/docs/docs/api/appkit/Class.AuthenticationError.md +236 -0
- package/docs/docs/api/appkit/Class.ConfigurationError/index.html +112 -0
- package/docs/docs/api/appkit/Class.ConfigurationError.md +243 -0
- package/docs/docs/api/appkit/Class.ConnectionError/index.html +120 -0
- package/docs/docs/api/appkit/Class.ConnectionError.md +265 -0
- package/docs/docs/api/appkit/Class.ExecutionError/index.html +116 -0
- package/docs/docs/api/appkit/Class.ExecutionError.md +250 -0
- package/docs/docs/api/appkit/Class.InitializationError/index.html +104 -0
- package/docs/docs/api/appkit/Class.InitializationError.md +222 -0
- package/docs/docs/api/appkit/Class.Plugin/index.html +149 -0
- package/docs/docs/api/appkit/Class.Plugin.md +392 -0
- package/docs/docs/api/appkit/Class.ServerError/index.html +108 -0
- package/docs/docs/api/appkit/Class.ServerError.md +229 -0
- package/docs/docs/api/appkit/Class.TunnelError/index.html +108 -0
- package/docs/docs/api/appkit/Class.TunnelError.md +231 -0
- package/docs/docs/api/appkit/Class.ValidationError/index.html +106 -0
- package/docs/docs/api/appkit/Class.ValidationError.md +225 -0
- package/docs/docs/api/appkit/Function.appKitTypesPlugin/index.html +24 -0
- package/docs/docs/api/appkit/Function.appKitTypesPlugin.md +20 -0
- package/docs/docs/api/appkit/Function.createApp/index.html +24 -0
- package/docs/docs/api/appkit/Function.createApp.md +31 -0
- package/docs/docs/api/appkit/Function.isSQLTypeMarker/index.html +25 -0
- package/docs/docs/api/appkit/Function.isSQLTypeMarker.md +32 -0
- package/docs/docs/api/appkit/Interface.BasePluginConfig/index.html +28 -0
- package/docs/docs/api/appkit/Interface.BasePluginConfig.md +37 -0
- package/docs/docs/api/appkit/Interface.CacheConfig/index.html +63 -0
- package/docs/docs/api/appkit/Interface.CacheConfig.md +131 -0
- package/docs/docs/api/appkit/Interface.ITelemetry/index.html +73 -0
- package/docs/docs/api/appkit/Interface.ITelemetry.md +144 -0
- package/docs/docs/api/appkit/Interface.StreamExecutionSettings/index.html +26 -0
- package/docs/docs/api/appkit/Interface.StreamExecutionSettings.md +30 -0
- package/docs/docs/api/appkit/Interface.TelemetryConfig/index.html +32 -0
- package/docs/docs/api/appkit/Interface.TelemetryConfig.md +48 -0
- package/docs/docs/api/appkit/TypeAlias.IAppRouter/index.html +18 -0
- package/docs/docs/api/appkit/TypeAlias.IAppRouter.md +8 -0
- package/docs/docs/api/appkit/Variable.sql/index.html +98 -0
- package/docs/docs/api/appkit/Variable.sql.md +260 -0
- package/docs/docs/api/appkit/index.html +28 -0
- package/docs/docs/api/appkit-ui/data/AreaChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/AreaChart.md +79 -0
- package/docs/docs/api/appkit-ui/data/BarChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/BarChart.md +74 -0
- package/docs/docs/api/appkit-ui/data/DataTable/index.html +36 -0
- package/docs/docs/api/appkit-ui/data/DataTable.md +69 -0
- package/docs/docs/api/appkit-ui/data/DonutChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/DonutChart.md +72 -0
- package/docs/docs/api/appkit-ui/data/HeatmapChart/index.html +35 -0
- package/docs/docs/api/appkit-ui/data/HeatmapChart.md +91 -0
- package/docs/docs/api/appkit-ui/data/LineChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/LineChart.md +77 -0
- package/docs/docs/api/appkit-ui/data/PieChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/PieChart.md +72 -0
- package/docs/docs/api/appkit-ui/data/RadarChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/RadarChart.md +74 -0
- package/docs/docs/api/appkit-ui/data/ScatterChart/index.html +29 -0
- package/docs/docs/api/appkit-ui/data/ScatterChart.md +76 -0
- package/docs/docs/api/appkit-ui/index.html +23 -0
- package/docs/docs/api/appkit-ui/styling/index.html +74 -0
- package/docs/docs/api/appkit-ui/styling.md +81 -0
- package/docs/docs/api/appkit-ui/ui/Accordion/index.html +48 -0
- package/docs/docs/api/appkit-ui/ui/Accordion.md +139 -0
- package/docs/docs/api/appkit-ui/ui/Alert/index.html +41 -0
- package/docs/docs/api/appkit-ui/ui/Alert.md +89 -0
- package/docs/docs/api/appkit-ui/ui/AlertDialog/index.html +97 -0
- package/docs/docs/api/appkit-ui/ui/AlertDialog.md +282 -0
- package/docs/docs/api/appkit-ui/ui/AspectRatio/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/AspectRatio.md +46 -0
- package/docs/docs/api/appkit-ui/ui/Avatar/index.html +41 -0
- package/docs/docs/api/appkit-ui/ui/Avatar.md +90 -0
- package/docs/docs/api/appkit-ui/ui/Badge/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Badge.md +38 -0
- package/docs/docs/api/appkit-ui/ui/Breadcrumb/index.html +69 -0
- package/docs/docs/api/appkit-ui/ui/Breadcrumb.md +193 -0
- package/docs/docs/api/appkit-ui/ui/Button/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Button.md +39 -0
- package/docs/docs/api/appkit-ui/ui/ButtonGroup/index.html +38 -0
- package/docs/docs/api/appkit-ui/ui/ButtonGroup.md +68 -0
- package/docs/docs/api/appkit-ui/ui/Calendar/index.html +34 -0
- package/docs/docs/api/appkit-ui/ui/Calendar.md +154 -0
- package/docs/docs/api/appkit-ui/ui/Card/index.html +69 -0
- package/docs/docs/api/appkit-ui/ui/Card.md +222 -0
- package/docs/docs/api/appkit-ui/ui/Carousel/index.html +55 -0
- package/docs/docs/api/appkit-ui/ui/Carousel.md +152 -0
- package/docs/docs/api/appkit-ui/ui/ChartContainer/index.html +58 -0
- package/docs/docs/api/appkit-ui/ui/ChartContainer.md +343 -0
- package/docs/docs/api/appkit-ui/ui/Checkbox/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Checkbox.md +53 -0
- package/docs/docs/api/appkit-ui/ui/Collapsible/index.html +41 -0
- package/docs/docs/api/appkit-ui/ui/Collapsible.md +125 -0
- package/docs/docs/api/appkit-ui/ui/Command/index.html +83 -0
- package/docs/docs/api/appkit-ui/ui/Command.md +287 -0
- package/docs/docs/api/appkit-ui/ui/ContextMenu/index.html +111 -0
- package/docs/docs/api/appkit-ui/ui/ContextMenu.md +419 -0
- package/docs/docs/api/appkit-ui/ui/Dialog/index.html +90 -0
- package/docs/docs/api/appkit-ui/ui/Dialog.md +285 -0
- package/docs/docs/api/appkit-ui/ui/Drawer/index.html +90 -0
- package/docs/docs/api/appkit-ui/ui/Drawer.md +387 -0
- package/docs/docs/api/appkit-ui/ui/DropdownMenu/index.html +111 -0
- package/docs/docs/api/appkit-ui/ui/DropdownMenu.md +478 -0
- package/docs/docs/api/appkit-ui/ui/Empty/index.html +54 -0
- package/docs/docs/api/appkit-ui/ui/Empty.md +109 -0
- package/docs/docs/api/appkit-ui/ui/Field/index.html +87 -0
- package/docs/docs/api/appkit-ui/ui/Field.md +201 -0
- package/docs/docs/api/appkit-ui/ui/FormControl/index.html +59 -0
- package/docs/docs/api/appkit-ui/ui/FormControl.md +128 -0
- package/docs/docs/api/appkit-ui/ui/HoverCard/index.html +39 -0
- package/docs/docs/api/appkit-ui/ui/HoverCard.md +131 -0
- package/docs/docs/api/appkit-ui/ui/Input/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Input.md +35 -0
- package/docs/docs/api/appkit-ui/ui/InputGroup/index.html +59 -0
- package/docs/docs/api/appkit-ui/ui/InputGroup.md +123 -0
- package/docs/docs/api/appkit-ui/ui/InputOTP/index.html +48 -0
- package/docs/docs/api/appkit-ui/ui/InputOTP.md +124 -0
- package/docs/docs/api/appkit-ui/ui/Item/index.html +78 -0
- package/docs/docs/api/appkit-ui/ui/Item.md +185 -0
- package/docs/docs/api/appkit-ui/ui/Kbd/index.html +30 -0
- package/docs/docs/api/appkit-ui/ui/Kbd.md +39 -0
- package/docs/docs/api/appkit-ui/ui/Label/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Label.md +44 -0
- package/docs/docs/api/appkit-ui/ui/Menubar/index.html +117 -0
- package/docs/docs/api/appkit-ui/ui/Menubar.md +484 -0
- package/docs/docs/api/appkit-ui/ui/NavigationMenu/index.html +76 -0
- package/docs/docs/api/appkit-ui/ui/NavigationMenu.md +338 -0
- package/docs/docs/api/appkit-ui/ui/Pagination/index.html +69 -0
- package/docs/docs/api/appkit-ui/ui/Pagination.md +191 -0
- package/docs/docs/api/appkit-ui/ui/Popover/index.html +45 -0
- package/docs/docs/api/appkit-ui/ui/Popover.md +173 -0
- package/docs/docs/api/appkit-ui/ui/Progress/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Progress.md +51 -0
- package/docs/docs/api/appkit-ui/ui/RadioGroup/index.html +33 -0
- package/docs/docs/api/appkit-ui/ui/RadioGroup.md +83 -0
- package/docs/docs/api/appkit-ui/ui/ResizableHandle/index.html +41 -0
- package/docs/docs/api/appkit-ui/ui/ResizableHandle.md +136 -0
- package/docs/docs/api/appkit-ui/ui/ScrollArea/index.html +34 -0
- package/docs/docs/api/appkit-ui/ui/ScrollArea.md +83 -0
- package/docs/docs/api/appkit-ui/ui/Select/index.html +82 -0
- package/docs/docs/api/appkit-ui/ui/Select.md +267 -0
- package/docs/docs/api/appkit-ui/ui/Separator/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Separator.md +56 -0
- package/docs/docs/api/appkit-ui/ui/Sheet/index.html +76 -0
- package/docs/docs/api/appkit-ui/ui/Sheet.md +236 -0
- package/docs/docs/api/appkit-ui/ui/Sidebar/index.html +183 -0
- package/docs/docs/api/appkit-ui/ui/Sidebar.md +490 -0
- package/docs/docs/api/appkit-ui/ui/Skeleton/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Skeleton.md +43 -0
- package/docs/docs/api/appkit-ui/ui/Slider/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Slider.md +61 -0
- package/docs/docs/api/appkit-ui/ui/Spinner/index.html +24 -0
- package/docs/docs/api/appkit-ui/ui/Spinner.md +22 -0
- package/docs/docs/api/appkit-ui/ui/Switch/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Switch.md +46 -0
- package/docs/docs/api/appkit-ui/ui/Table/index.html +69 -0
- package/docs/docs/api/appkit-ui/ui/Table.md +236 -0
- package/docs/docs/api/appkit-ui/ui/Tabs/index.html +48 -0
- package/docs/docs/api/appkit-ui/ui/Tabs.md +177 -0
- package/docs/docs/api/appkit-ui/ui/Textarea/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Textarea.md +35 -0
- package/docs/docs/api/appkit-ui/ui/Toaster/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Toaster.md +75 -0
- package/docs/docs/api/appkit-ui/ui/Toggle/index.html +27 -0
- package/docs/docs/api/appkit-ui/ui/Toggle.md +48 -0
- package/docs/docs/api/appkit-ui/ui/ToggleGroup/index.html +33 -0
- package/docs/docs/api/appkit-ui/ui/ToggleGroup.md +88 -0
- package/docs/docs/api/appkit-ui/ui/Tooltip/index.html +46 -0
- package/docs/docs/api/appkit-ui/ui/Tooltip.md +134 -0
- package/docs/docs/api/appkit-ui.md +15 -0
- package/docs/docs/api/appkit.md +48 -0
- package/docs/docs/api/index.html +28 -0
- package/docs/docs/api.md +24 -0
- package/docs/docs/app-management/index.html +106 -0
- package/docs/docs/app-management.md +171 -0
- package/docs/docs/architecture/index.html +71 -0
- package/docs/docs/architecture.md +69 -0
- package/docs/docs/category/development/index.html +16 -0
- package/docs/docs/category/development.md +3 -0
- package/docs/docs/configuration/index.html +66 -0
- package/docs/docs/configuration.md +150 -0
- package/docs/docs/core-principles/index.html +38 -0
- package/docs/docs/core-principles.md +31 -0
- package/docs/docs/development/index.html +34 -0
- package/docs/docs/development/llm-guide/index.html +74 -0
- package/docs/docs/development/llm-guide.md +74 -0
- package/docs/docs/development/local-development/index.html +27 -0
- package/docs/docs/development/local-development.md +20 -0
- package/docs/docs/development/project-setup/index.html +69 -0
- package/docs/docs/development/project-setup.md +246 -0
- package/docs/docs/development/remote-bridge/index.html +76 -0
- package/docs/docs/development/remote-bridge.md +80 -0
- package/docs/docs/development/type-generation/index.html +65 -0
- package/docs/docs/development/type-generation.md +110 -0
- package/docs/docs/development.md +21 -0
- package/docs/docs/index.html +58 -0
- package/docs/docs/plugins/index.html +151 -0
- package/docs/docs/plugins.md +313 -0
- package/docs/docs.md +64 -0
- package/llms.txt +121 -1231
- package/package.json +11 -11
- package/scripts/postinstall.js +1 -1
- package/AGENTS.md +0 -1234
- package/bin/appkit-lint.js +0 -129
- package/bin/generate-types.js +0 -27
- package/bin/setup-claude.js +0 -190
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
Draggable panel that slides in from screen edges
|
|
4
|
+
|
|
5
|
+
## Example[](#example "Direct link to Example")
|
|
6
|
+
|
|
7
|
+
<!-- -->
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client"
|
|
11
|
+
|
|
12
|
+
import * as React from "react"
|
|
13
|
+
import { Minus, Plus } from "lucide-react"
|
|
14
|
+
import { Bar, BarChart, ResponsiveContainer } from "recharts"
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
Button,
|
|
18
|
+
Drawer,
|
|
19
|
+
DrawerClose,
|
|
20
|
+
DrawerContent,
|
|
21
|
+
DrawerDescription,
|
|
22
|
+
DrawerFooter,
|
|
23
|
+
DrawerHeader,
|
|
24
|
+
DrawerTitle,
|
|
25
|
+
DrawerTrigger,
|
|
26
|
+
} from "@databricks/appkit-ui/react"
|
|
27
|
+
|
|
28
|
+
const data = [
|
|
29
|
+
{
|
|
30
|
+
goal: 400,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
goal: 300,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
goal: 200,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
goal: 300,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
goal: 200,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
goal: 278,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
goal: 189,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
goal: 239,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
goal: 300,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
goal: 200,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
goal: 278,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
goal: 189,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
goal: 349,
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
export default function DrawerExample() {
|
|
71
|
+
const [goal, setGoal] = React.useState(350)
|
|
72
|
+
|
|
73
|
+
function onClick(adjustment: number) {
|
|
74
|
+
setGoal(Math.max(200, Math.min(400, goal + adjustment)))
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Drawer>
|
|
79
|
+
<DrawerTrigger asChild>
|
|
80
|
+
<Button variant="outline">Open Drawer</Button>
|
|
81
|
+
</DrawerTrigger>
|
|
82
|
+
<DrawerContent>
|
|
83
|
+
<div className="mx-auto w-full max-w-sm">
|
|
84
|
+
<DrawerHeader>
|
|
85
|
+
<DrawerTitle>Move Goal</DrawerTitle>
|
|
86
|
+
<DrawerDescription>Set your daily activity goal.</DrawerDescription>
|
|
87
|
+
</DrawerHeader>
|
|
88
|
+
<div className="p-4 pb-0">
|
|
89
|
+
<div className="flex items-center justify-center space-x-2">
|
|
90
|
+
<Button
|
|
91
|
+
variant="outline"
|
|
92
|
+
size="icon"
|
|
93
|
+
className="h-8 w-8 shrink-0 rounded-full"
|
|
94
|
+
onClick={() => onClick(-10)}
|
|
95
|
+
disabled={goal <= 200}
|
|
96
|
+
>
|
|
97
|
+
<Minus />
|
|
98
|
+
<span className="sr-only">Decrease</span>
|
|
99
|
+
</Button>
|
|
100
|
+
<div className="flex-1 text-center">
|
|
101
|
+
<div className="text-7xl font-bold tracking-tighter">
|
|
102
|
+
{goal}
|
|
103
|
+
</div>
|
|
104
|
+
<div className="text-[0.70rem] uppercase text-muted-foreground">
|
|
105
|
+
Calories/day
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<Button
|
|
109
|
+
variant="outline"
|
|
110
|
+
size="icon"
|
|
111
|
+
className="h-8 w-8 shrink-0 rounded-full"
|
|
112
|
+
onClick={() => onClick(10)}
|
|
113
|
+
disabled={goal >= 400}
|
|
114
|
+
>
|
|
115
|
+
<Plus />
|
|
116
|
+
<span className="sr-only">Increase</span>
|
|
117
|
+
</Button>
|
|
118
|
+
</div>
|
|
119
|
+
<div className="mt-3 h-[120px]">
|
|
120
|
+
<ResponsiveContainer width="100%" height="100%">
|
|
121
|
+
<BarChart data={data}>
|
|
122
|
+
<Bar
|
|
123
|
+
dataKey="goal"
|
|
124
|
+
style={{
|
|
125
|
+
fill: "hsl(var(--foreground))",
|
|
126
|
+
opacity: 0.9,
|
|
127
|
+
}}
|
|
128
|
+
/>
|
|
129
|
+
</BarChart>
|
|
130
|
+
</ResponsiveContainer>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
<DrawerFooter>
|
|
134
|
+
<Button>Submit</Button>
|
|
135
|
+
<DrawerClose asChild>
|
|
136
|
+
<Button variant="outline">Cancel</Button>
|
|
137
|
+
</DrawerClose>
|
|
138
|
+
</DrawerFooter>
|
|
139
|
+
</div>
|
|
140
|
+
</DrawerContent>
|
|
141
|
+
</Drawer>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Drawer[](#drawer-1 "Direct link to Drawer")
|
|
148
|
+
|
|
149
|
+
Draggable panel that slides in from screen edges
|
|
150
|
+
|
|
151
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
152
|
+
|
|
153
|
+
### Props[](#props "Direct link to Props")
|
|
154
|
+
|
|
155
|
+
| Prop | Type | Required | Default | Description |
|
|
156
|
+
| --------------------------- | ---------------------------------------------------------------------------- | -------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
157
|
+
| `activeSnapPoint` | `string \| number \| null` | | - | - |
|
|
158
|
+
| `setActiveSnapPoint` | `((snapPoint: string \| number \| null) => void)` | | - | - |
|
|
159
|
+
| `open` | `boolean` | | - | - |
|
|
160
|
+
| `closeThreshold` | `number` | | `0.25` | Number between 0 and 1 that determines when the drawer should be closed. Example: threshold of 0.5 would close the drawer if the user swiped for 50% of the height of the drawer or more. |
|
|
161
|
+
| `noBodyStyles` | `boolean` | | - | When `true` the `body` doesn't get any styles assigned from Vaul |
|
|
162
|
+
| `onOpenChange` | `((open: boolean) => void)` | | - | - |
|
|
163
|
+
| `shouldScaleBackground` | `boolean` | | - | - |
|
|
164
|
+
| `setBackgroundColorOnScale` | `boolean` | | `true` | When `false` we don't change body's background color when the drawer is open. |
|
|
165
|
+
| `scrollLockTimeout` | `number` | | `500ms` | Duration for which the drawer is not draggable after scrolling content inside of the drawer. |
|
|
166
|
+
| `fixed` | `boolean` | | - | When `true`, don't move the drawer upwards if there's space, but rather only change it's height so it's fully scrollable when the keyboard is open |
|
|
167
|
+
| `handleOnly` | `boolean` | | `false` | When `true` only allows the drawer to be dragged by the `<Drawer.Handle />` component. |
|
|
168
|
+
| `dismissible` | `boolean` | | `true` | When `false` dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in comination with the `open` prop, otherwise you won't be able to open/close the drawer. |
|
|
169
|
+
| `onDrag` | `((event: PointerEvent<HTMLDivElement>, percentageDragged: number) => void)` | | - | - |
|
|
170
|
+
| `onRelease` | `((event: PointerEvent<HTMLDivElement>, open: boolean) => void)` | | - | - |
|
|
171
|
+
| `modal` | `boolean` | | `true` | When `false` it allows to interact with elements outside of the drawer without closing it. |
|
|
172
|
+
| `nested` | `boolean` | | - | - |
|
|
173
|
+
| `onClose` | `(() => void)` | | - | - |
|
|
174
|
+
| `direction` | `enum` | | `'bottom'` | Direction of the drawer. Can be `top` or `bottom`, `left`, `right`. |
|
|
175
|
+
| `defaultOpen` | `boolean` | | `false` | Opened by default, skips initial enter animation. Still reacts to `open` state changes |
|
|
176
|
+
| `disablePreventScroll` | `boolean` | | `false` | When set to `true` prevents scrolling on the document body on mount, and restores it on unmount. |
|
|
177
|
+
| `repositionInputs` | `boolean` | | `true when {@link snapPoints } is defined` | When `true` Vaul will reposition inputs rather than scroll then into view if the keyboard is in the way. Setting it to `false` will fall back to the default browser behavior. |
|
|
178
|
+
| `snapToSequentialPoint` | `boolean` | | `false` | Disabled velocity based swiping for snap points. This means that a snap point won't be skipped even if the velocity is high enough. Useful if each snap point in a drawer is equally important. |
|
|
179
|
+
| `container` | `HTMLElement \| null` | | - | - |
|
|
180
|
+
| `onAnimationEnd` | `((open: boolean) => void)` | | - | Gets triggered after the open or close animation ends, it receives an `open` argument with the `open` state of the drawer by the time the function was triggered. Useful to revert any state changes for example. |
|
|
181
|
+
| `preventScrollRestoration` | `boolean` | | - | - |
|
|
182
|
+
| `autoFocus` | `boolean` | | - | - |
|
|
183
|
+
| `snapPoints` | `(string \| number)[]` | | - | Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Example `[0.2, 0.5, 0.8]`. You can also use px values, which doesn't take screen height into account. |
|
|
184
|
+
| `fadeFromIndex` | `number` | | - | Index of a `snapPoint` from which the overlay fade should be applied. Defaults to the last snap point. |
|
|
185
|
+
|
|
186
|
+
### Usage[](#usage "Direct link to Usage")
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import { Drawer } from '@databricks/appkit-ui';
|
|
190
|
+
|
|
191
|
+
<Drawer /* props */ />
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## DrawerClose[](#drawerclose "Direct link to DrawerClose")
|
|
196
|
+
|
|
197
|
+
Button that closes the drawer
|
|
198
|
+
|
|
199
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
200
|
+
|
|
201
|
+
### Props[](#props-1 "Direct link to Props")
|
|
202
|
+
|
|
203
|
+
| Prop | Type | Required | Default | Description |
|
|
204
|
+
| --------- | --------- | -------- | ------- | ----------- |
|
|
205
|
+
| `asChild` | `boolean` | | - | - |
|
|
206
|
+
|
|
207
|
+
### Usage[](#usage-1 "Direct link to Usage")
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { DrawerClose } from '@databricks/appkit-ui';
|
|
211
|
+
|
|
212
|
+
<DrawerClose /* props */ />
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## DrawerContent[](#drawercontent "Direct link to DrawerContent")
|
|
217
|
+
|
|
218
|
+
Main content area of the drawer
|
|
219
|
+
|
|
220
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
221
|
+
|
|
222
|
+
### Props[](#props-2 "Direct link to Props")
|
|
223
|
+
|
|
224
|
+
| Prop | Type | Required | Default | Description |
|
|
225
|
+
| ---------------------- | ----------------------------------------------------------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
226
|
+
| `asChild` | `boolean` | | - | - |
|
|
227
|
+
| `forceMount` | `true` | | - | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
|
|
228
|
+
| `onEscapeKeyDown` | `((event: KeyboardEvent) => void)` | | - | Event handler called when the escape key is down. Can be prevented. |
|
|
229
|
+
| `onPointerDownOutside` | `((event: PointerDownOutsideEvent) => void)` | | - | Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. Can be prevented. |
|
|
230
|
+
| `onFocusOutside` | `((event: FocusOutsideEvent) => void)` | | - | Event handler called when the focus moves outside of the `DismissableLayer`. Can be prevented. |
|
|
231
|
+
| `onInteractOutside` | `((event: FocusOutsideEvent \| PointerDownOutsideEvent) => void)` | | - | Event handler called when an interaction happens outside the `DismissableLayer`. Specifically, when a `pointerdown` event happens outside or focus moves outside of it. Can be prevented. |
|
|
232
|
+
| `onOpenAutoFocus` | `((event: Event) => void)` | | - | Event handler called when auto-focusing on open. Can be prevented. |
|
|
233
|
+
| `onCloseAutoFocus` | `((event: Event) => void)` | | - | Event handler called when auto-focusing on close. Can be prevented. |
|
|
234
|
+
|
|
235
|
+
### Usage[](#usage-2 "Direct link to Usage")
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
import { DrawerContent } from '@databricks/appkit-ui';
|
|
239
|
+
|
|
240
|
+
<DrawerContent /* props */ />
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## DrawerDescription[](#drawerdescription "Direct link to DrawerDescription")
|
|
245
|
+
|
|
246
|
+
Description text for the drawer
|
|
247
|
+
|
|
248
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
249
|
+
|
|
250
|
+
### Props[](#props-3 "Direct link to Props")
|
|
251
|
+
|
|
252
|
+
| Prop | Type | Required | Default | Description |
|
|
253
|
+
| --------- | --------- | -------- | ------- | ----------- |
|
|
254
|
+
| `asChild` | `boolean` | | - | - |
|
|
255
|
+
|
|
256
|
+
### Usage[](#usage-3 "Direct link to Usage")
|
|
257
|
+
|
|
258
|
+
```tsx
|
|
259
|
+
import { DrawerDescription } from '@databricks/appkit-ui';
|
|
260
|
+
|
|
261
|
+
<DrawerDescription /* props */ />
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## DrawerFooter[](#drawerfooter "Direct link to DrawerFooter")
|
|
266
|
+
|
|
267
|
+
Footer section of the drawer
|
|
268
|
+
|
|
269
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
270
|
+
|
|
271
|
+
### Props[](#props-4 "Direct link to Props")
|
|
272
|
+
|
|
273
|
+
This component extends standard HTML element attributes.
|
|
274
|
+
|
|
275
|
+
### Usage[](#usage-4 "Direct link to Usage")
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import { DrawerFooter } from '@databricks/appkit-ui';
|
|
279
|
+
|
|
280
|
+
<DrawerFooter /* props */ />
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## DrawerHeader[](#drawerheader "Direct link to DrawerHeader")
|
|
285
|
+
|
|
286
|
+
Header section of the drawer
|
|
287
|
+
|
|
288
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
289
|
+
|
|
290
|
+
### Props[](#props-5 "Direct link to Props")
|
|
291
|
+
|
|
292
|
+
This component extends standard HTML element attributes.
|
|
293
|
+
|
|
294
|
+
### Usage[](#usage-5 "Direct link to Usage")
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
import { DrawerHeader } from '@databricks/appkit-ui';
|
|
298
|
+
|
|
299
|
+
<DrawerHeader /* props */ />
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## DrawerOverlay[](#draweroverlay "Direct link to DrawerOverlay")
|
|
304
|
+
|
|
305
|
+
Dimmed overlay behind the drawer
|
|
306
|
+
|
|
307
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
308
|
+
|
|
309
|
+
### Props[](#props-6 "Direct link to Props")
|
|
310
|
+
|
|
311
|
+
| Prop | Type | Required | Default | Description |
|
|
312
|
+
| ------------ | --------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
313
|
+
| `asChild` | `boolean` | | - | - |
|
|
314
|
+
| `forceMount` | `true` | | - | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
|
|
315
|
+
|
|
316
|
+
### Usage[](#usage-6 "Direct link to Usage")
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
import { DrawerOverlay } from '@databricks/appkit-ui';
|
|
320
|
+
|
|
321
|
+
<DrawerOverlay /* props */ />
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## DrawerPortal[](#drawerportal "Direct link to DrawerPortal")
|
|
326
|
+
|
|
327
|
+
Portal container for drawer content
|
|
328
|
+
|
|
329
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
330
|
+
|
|
331
|
+
### Props[](#props-7 "Direct link to Props")
|
|
332
|
+
|
|
333
|
+
| Prop | Type | Required | Default | Description |
|
|
334
|
+
| ------------ | ------------------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
335
|
+
| `container` | `Element \| DocumentFragment \| null` | | - | Specify a container element to portal the content into. |
|
|
336
|
+
| `forceMount` | `true` | | - | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
|
|
337
|
+
|
|
338
|
+
### Usage[](#usage-7 "Direct link to Usage")
|
|
339
|
+
|
|
340
|
+
```tsx
|
|
341
|
+
import { DrawerPortal } from '@databricks/appkit-ui';
|
|
342
|
+
|
|
343
|
+
<DrawerPortal /* props */ />
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## DrawerTitle[](#drawertitle "Direct link to DrawerTitle")
|
|
348
|
+
|
|
349
|
+
Title text for the drawer
|
|
350
|
+
|
|
351
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
352
|
+
|
|
353
|
+
### Props[](#props-8 "Direct link to Props")
|
|
354
|
+
|
|
355
|
+
| Prop | Type | Required | Default | Description |
|
|
356
|
+
| --------- | --------- | -------- | ------- | ----------- |
|
|
357
|
+
| `asChild` | `boolean` | | - | - |
|
|
358
|
+
|
|
359
|
+
### Usage[](#usage-8 "Direct link to Usage")
|
|
360
|
+
|
|
361
|
+
```tsx
|
|
362
|
+
import { DrawerTitle } from '@databricks/appkit-ui';
|
|
363
|
+
|
|
364
|
+
<DrawerTitle /* props */ />
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
## DrawerTrigger[](#drawertrigger "Direct link to DrawerTrigger")
|
|
369
|
+
|
|
370
|
+
Button that opens the drawer
|
|
371
|
+
|
|
372
|
+
**Source:** [`packages/appkit-ui/src/react/ui/drawer.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/ui/drawer.tsx)
|
|
373
|
+
|
|
374
|
+
### Props[](#props-9 "Direct link to Props")
|
|
375
|
+
|
|
376
|
+
| Prop | Type | Required | Default | Description |
|
|
377
|
+
| --------- | --------- | -------- | ------- | ----------- |
|
|
378
|
+
| `asChild` | `boolean` | | - | - |
|
|
379
|
+
|
|
380
|
+
### Usage[](#usage-9 "Direct link to Usage")
|
|
381
|
+
|
|
382
|
+
```tsx
|
|
383
|
+
import { DrawerTrigger } from '@databricks/appkit-ui';
|
|
384
|
+
|
|
385
|
+
<DrawerTrigger /* props */ />
|
|
386
|
+
|
|
387
|
+
```
|