vael-ui v0.5.7

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:

Props

NameTypeDefaultDescription
side'top' | 'right' | 'bottom' | 'left''top'Default side for targets whose v-tooltip value doesn't set one.
openDelaynumber400Delay before a cold open, in milliseconds. Warm-group opens are instant.
closeDelaynumber100Grace period after the pointer leaves, in milliseconds, so it can move onto the tooltip.
beforeCloseBeforeClose<TooltipCloseReason>The beforeClose for every v-tooltip target; set v-tooltip="{ beforeClose }" to override one. Return true to close the tooltip, false to keep it open, or a promise of either. The tooltip stays open while the promise is pending.
forceMountbooleanfalseGlobal default for every v-tooltip target; override it per target with v-tooltip="{ forceMount }".
motionTooltipMotionHow every v-tooltip moves, like Tooltip's motion: false shows and hides them at once, an object moves them your way. Warm opens stay instant either way.
uiPartial<Record<'positioner' | 'panel', UiPartValue>>Class and style overrides for each part. Set --ui-tooltip-bg and --ui-tooltip-color on panel to recolour it.

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>