Usage
Use a v-model to control the Slideover state.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}You can put a Card component inside your Slideover to handle forms and take advantage of header and footer slots:
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Disable overlay
Set the overlay prop to false to disable it.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Disable transition
Set the transition prop to false to disable it.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Prevent close
Use the prevent-close prop to disable the outside click alongside the esc keyboard shortcut. A close-prevented event will be emitted when the user tries to close the slideover.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}You can still handle the esc shortcut yourself by using our defineShortcuts composable.
<script setup lang="ts">
const isOpen = ref(false)
defineShortcuts({
escape: {
usingInput: true,
whenever: [isOpen],
handler: () => { isOpen.value = false }
}
})
</script>
Control programmatically
First of all, add the USlideovers component to your app, preferably inside app.vue.
app.vue
<template>
<div>
<UContainer>
<NuxtPage />
</UContainer>
<USlideovers />
</div>
</template>
Then, you can use the useSlideover composable to control your slideovers within your app.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Props
ui
{ wrapper?: string; overlay?: DeepPartial<{ base: string; background: string; transition: { enter: string; enterFrom: string; enterTo: string; leave: string; leaveFrom: string; leaveTo: string; }; }, any>; base?: string; background?: string; ring?: string; rounded?: string; padding?: string; shadow?: string; width?: string; height?: string; translate?: DeepPartial<{ base: string; left: string; right: string; top: string; bottom: string; }, any>; transition?: DeepPartial<{ enter: string; leave: string; }, any>; } & { [key: string]: any; } & { strategy?: Strategy; }
{}side
"left" | "right" | "bottom" | "top"
"right"onClose
(...args: any[]) => any
onUpdate:modelValue
(...args: any[]) => any
onClose-prevented
(...args: any[]) => any
onAfter-leave
(...args: any[]) => any
transition
boolean
truemodelValue
boolean
falseappear
boolean
falseoverlay
boolean
truepreventClose
boolean
falseConfig
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}