vael-ui v0.5.7

Setup

Layout

ConfigProvider

A wrapper that sets the theme, size, language, class merging and motion for every component inside it. Use it at the root of your app to set them once.

Install

import { ConfigProvider } from 'vael-ui'

Playground

3

Nested content

Everything inside this ConfigProvider uses its theme.

<ConfigProvider
  :theme="{ primary: '#ea580c', radius: '12px', fontSize: '14px' }"
>
  <YourApp />
</ConfigProvider>

Props

NameTypeDefaultDescription
i18nI18nInstanceI18n instance (e.g. useI18n() return value). Missing keys fall back to English defaults, and its current locale formats dates and numbers.
messagesPartialUiMessagesStatic message overrides, applied on top of i18n resolution.
localestringBCP-47 locale for dates, numbers and the week start inside, e.g. 'de-DE'. Wins over i18n's locale. Set it when you render on a server, or they follow the server's language.
classMergeClassMergerClass merger function (e.g. twMerge from tailwind-merge), applied to every ui.* part class.
themeUiThemeAuto-derives colors and applies radius and component font size. Injects a scoped <style> tag.
size'sm' | 'md' | 'lg'Default size for buttons, form controls and tables inside. A component's own size wins.
motionboolean | MotionOptions | MotionStyleMotion for everything inside. false makes every component change instantly, e.g. for screenshot tests: panels still open and close and toasts still leave. { spring } puts drawers, sheets, toasts, sliding indicators and AnimatedNumber on one spring (below 1, damping overshoots); crossfades such as AnimatedText keep their own timing. { valueSwap: false } shows a picked value in Select, Combobox, TreeSelect, CascadeSelect and DatePicker without its crossfade. A full style ({ version: 1, … }) sets how every role and component moves, defined once. A component's own motion wins.
loaderTypeLoaderSource'ring'Animation for every loader inside: Loader, Button's loading state, list loading rows, loading toasts and PullToRefresh. A built-in name, or your own component (or render function), drawn in the same 1em box. A component's own type or loaderType wins.
indicatorIndicatorMode'glide'How every sliding indicator inside moves: the hover highlight in lists and menus, and the selection in Tabs, SelectButton, Pagination and MenuList. 'glide', 'instant', or a spring such as { damping: 0.55, response: 0.3 } (below 1, damping overshoots). motion: false still makes them instant.
hapticsboolean | HapticOptionsundefined (yours play, vael-ui's stay silent)Haptics on phones that offer them. true, or { intensity } to scale them, turns on vael-ui's own: a Switch flipping, a swiped row snapping, a Sortable row landing, a pull passing the refresh point, a held Button completing. false silences every useHaptic call inside too, yours included.

Events

No events.

Slots

NameTypeDescription
defaultanyApp content that receives these settings.

Exposed

Nothing exposed through a template ref.

Accessibility

It has no keyboard interaction of its own.

  • Renders a display: contents wrapper with no role, so it adds nothing to the accessibility tree.
  • i18n and messages translate the accessible names vael-ui supplies, such as “Dismiss”, “More actions”, “Notifications” and the hold hint “Press and hold to confirm”.
  • motion: false sets every duration token inside to 0s, so components change at once.
  • It doesn’t set dir. Components read the computed direction, so put dir="rtl" on an ancestor and the arrow keys follow it.