Skip to content

Commit

Permalink
docs(slideover): add close button in some examples for mobile (nuxt#1827
Browse files Browse the repository at this point in the history
)

Co-authored-by: Benjamin Canac <[email protected]>
  • Loading branch information
khaledOghli and benjamincanac authored Jun 3, 2024
1 parent 06990be commit 831c560
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/components/content/examples/SlideoverExampleBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ const isOpen = ref(false)

<USlideover v-model="isOpen">
<div class="p-4 flex-1">
<UButton
color="gray"
variant="ghost"
size="sm"
icon="i-heroicons-x-mark-20-solid"
class="flex sm:hidden absolute end-5 top-5 z-10"
square
padded
@click="isOpen = false"
/>
<Placeholder class="h-full" />
</div>
</USlideover>
Expand Down
16 changes: 15 additions & 1 deletion docs/components/content/examples/SlideoverExampleCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ const isOpen = ref(false)
<UButton label="Open" @click="isOpen = true" />

<USlideover v-model="isOpen">
<UCard class="flex flex-col flex-1" :ui="{ body: { base: 'flex-1' }, ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<UCard
class="flex flex-col flex-1"
:ui="{ body: { base: 'flex-1' }, ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }"
>
<template #header>
<UButton
color="gray"
variant="ghost"
size="sm"
icon="i-heroicons-x-mark-20-solid"
class="flex sm:hidden absolute end-5 top-5 z-10"
square
padded
@click="isOpen = false"
/>

<Placeholder class="h-8" />
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ const isOpen = ref(false)

<USlideover v-model="isOpen" :overlay="false">
<div class="p-4 flex-1">
<UButton
color="gray"
variant="ghost"
size="sm"
icon="i-heroicons-x-mark-20-solid"
class="flex sm:hidden absolute end-5 top-5 z-10"
square
padded
@click="isOpen = false"
/>

<Placeholder class="h-full" />
</div>
</USlideover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ const isOpen = ref(false)

<USlideover v-model="isOpen" :transition="false">
<div class="p-4 flex-1">
<UButton
color="gray"
variant="ghost"
size="sm"
icon="i-heroicons-x-mark-20-solid"
class="flex sm:hidden absolute end-5 top-5 z-10"
square
padded
@click="isOpen = false"
/>

<Placeholder class="h-full" />
</div>
</USlideover>
Expand Down

0 comments on commit 831c560

Please sign in to comment.