Global setup
vael-ui has four singletons: components you mount once, anywhere in your app, for every other component to use.
TooltipHost
Renders every v-tooltip. If it isn’t mounted, tooltips never appear, and no error tells you why.
<template>
<TooltipHost />
<YourApp />
</template>It takes the same options that each tooltip can override:
DialogHost
Renders dialogs you open from code with openDialog() or confirmAction(). A <Dialog v-model:open> in your own template doesn’t need it. It has no props or configuration.
<template>
<DialogHost />
<YourApp />
</template>PopoverHost
Renders popovers you open from code with openPopover(), or with confirmAction() and surface: 'popover'. A <Popover v-model:open> in your own template doesn’t need it. It has no props or configuration.
<template>
<PopoverHost />
<YourApp />
</template>Toaster
Renders the toasts that toast() creates. It has its own props, so it’s documented on its own page.
<template>
<Toaster />
<YourApp />
</template>All together
Mount all four once, in your app’s root template. Without a ConfigProvider:
<script setup lang="ts">
import { DialogHost, PopoverHost, Toaster, TooltipHost } from 'vael-ui'
</script>
<template>
<TooltipHost />
<DialogHost />
<PopoverHost />
<Toaster />
<YourApp />
</template>With a ConfigProvider, put them inside it. A host renders what you open from code (openDialog(), toast(), tooltips), so those take the provider’s theme, motion, messages and size only when the host sits inside it:
<script setup lang="ts">
import { ConfigProvider, DialogHost, PopoverHost, Toaster, TooltipHost } from 'vael-ui'
</script>
<template>
<ConfigProvider :motion="{ spring: 'snappy' }">
<TooltipHost />
<DialogHost />
<PopoverHost />
<Toaster />
<YourApp />
</ConfigProvider>
</template>