Skip to content

Commit 0a72024

Browse files
committed
docs(drawer): add interactive background example
Resolves #4199
1 parent 41087d4 commit 0a72024

File tree

6 files changed

+44
-5
lines changed

6 files changed

+44
-5
lines changed

docs/app/components/content/examples/drawer/DrawerDismissibleExample.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const open = ref(false)
33
</script>
44

55
<template>
6-
<UDrawer v-model:open="open" :dismissible="false" :ui="{ header: 'flex items-center justify-between' }">
6+
<UDrawer v-model:open="open" :dismissible="false" :handle="false" :ui="{ header: 'flex items-center justify-between' }">
77
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-lucide-chevron-up" />
88

99
<template #header>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<script setup lang="ts">
2+
const open = ref(false)
3+
</script>
4+
5+
<template>
6+
<UDrawer
7+
v-model:open="open"
8+
:dismissible="false"
9+
:overlay="false"
10+
:handle="false"
11+
:modal="false"
12+
:ui="{ header: 'flex items-center justify-between' }"
13+
>
14+
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-lucide-chevron-up" />
15+
16+
<template #header>
17+
<h2 class="text-highlighted font-semibold">
18+
Drawer non-dismissible
19+
</h2>
20+
21+
<UButton color="neutral" variant="ghost" icon="i-lucide-x" @click="open = false" />
22+
</template>
23+
24+
<template #body>
25+
<Placeholder class="h-48" />
26+
</template>
27+
</UDrawer>
28+
</template>

docs/content/3.components/drawer.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts),
291291
This allows you to move the trigger outside of the Drawer or remove it entirely.
292292
::
293293

294-
### Prevent closing
294+
### Disable dismissal
295295

296296
Set the `dismissible` prop to `false` to prevent the Drawer from being closed when clicking outside of it or pressing escape.
297297

@@ -306,6 +306,17 @@ name: 'drawer-dismissible-example'
306306
In this example, the `header` slot is used to add a close button which is not done by default.
307307
::
308308

309+
### With interactive background
310+
311+
Set the `overlay` and `modal` props to `false` alongside the `dismissible` prop to make the Drawer's background interactive without closing the Drawer.
312+
313+
::component-example
314+
---
315+
prettier: true
316+
name: 'drawer-modal-example'
317+
---
318+
::
319+
309320
### Responsive drawer
310321

311322
You can render a [Modal](/components/modal) component on desktop and a Drawer on mobile for example.

docs/content/3.components/modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts),
274274
This allows you to move the trigger outside of the Modal or remove it entirely.
275275
::
276276

277-
### Prevent closing
277+
### Disable dismissal
278278

279279
Set the `dismissible` prop to `false` to prevent the Modal from being closed when clicking outside of it or pressing escape. A `close:prevent` event will be emitted when the user tries to close it.
280280

docs/content/3.components/popover.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ name: 'popover-open-example'
181181
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Popover by pressing :kbd{value="O"}.
182182
::
183183

184-
### Prevent closing
184+
### Disable dismissal
185185

186186
Set the `dismissible` prop to `false` to prevent the Popover from being closed when clicking outside of it or pressing escape. A `close:prevent` event will be emitted when the user tries to close it.
187187

docs/content/3.components/slideover.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts),
273273
This allows you to move the trigger outside of the Slideover or remove it entirely.
274274
::
275275

276-
### Prevent closing
276+
### Disable dismissal
277277

278278
Set the `dismissible` prop to `false` to prevent the Slideover from being closed when clicking outside of it or pressing escape. A `close:prevent` event will be emitted when the user tries to close it.
279279

0 commit comments

Comments
 (0)