vael-ui v0.5.7

TypeScript

Your editor knows every component's parts and states, every CSS property and vael-ui's timing tokens. A mistake turns red before you save.

Autocomplete

Select a name in the code to see what your editor suggests there, then pick one to insert it.

<Dialog :motion="{
initial: { : { : 12 } },
easing: '',
duration: ,
}" />

The same names are listed in Dialog's Motion section.

Mistakes are type errors

vael-ui's own type tests check that each of these stays an error, so no release starts accepting one by accident.

A part it doesn't have<Dialog :motion="{ initial: { backdrop: { opacity: 0 } } }" />

'backdrop' does not exist in type 'PartValues<DialogPart>'.

A misspelled CSS property<Dialog :motion="{ initial: { panel: { opacityy: 0 } } }" />

'opacityy' does not exist in type 'MotionValues | ((where: MotionWhere) => MotionValues)'.

A spring and a duration together<Dialog :motion="{ spring: { damping: 1 }, duration: 200 }" />

Type 'number' is not assignable to type '"use spring, or duration with easing, not both"'.

A state it doesn't have<Input :motion="{ states: { success: { root: { opacity: 1 } } } }" />

'success' does not exist in type 'StateMotion<"disabled" | "invalid" | "focus", InputPart>'.

A list option on a dialog<Dialog :motion="{ stagger: 0.05 }" />

'stagger' does not exist in type '… & OverlayMotion & SwapMotion'.

A style without its versionconst style: MotionStyle = { spring: { damping: 1 } }

Property 'version' is missing in type '{ spring: { damping: number; }; }' but required in type 'MotionStyle'.

Units

A plain number uses the unit shown. A string goes straight to CSS, so '2rem' and '50%' work too.

  • duration: 250milliseconds
  • delay: 0.1seconds
  • stagger: 0.04seconds
  • spring.response: 0.35seconds
  • x: 12pixels
  • blur: 4pixels
  • rotate: 90degrees
  • opacity: 0.5no unit

Timing tokens

duration and easing accept vael-ui's tokens, and your editor lists them. Below are their current values on this page. Pick a preset from the motion menu in the header, and the tokens a spring drives change with it.

  • --ui-duration-press0 ms
  • --ui-duration-enter0 ms
  • --ui-duration-exit0 ms
  • --ui-duration-tooltip0 ms
  • --ui-duration-toast0 ms
  • --ui-duration-drawer0 ms
  • --ui-duration-drawer-exit0 ms
  • --ui-ease-out
  • --ui-ease-in-out
  • --ui-ease-drawer
  • --ui-ease-pop
  • --ui-ease-bounce
  • --ui-ease-toast
  • --ui-ease-number

In the console

In development, vael-ui logs what went wrong and what to change. Production builds leave these messages out.

[vael-ui motion] Dialog enter: something was still animating when the hook returned. Return the animation so Dialog waits: `enter: (parts) => gsap.to(...)`.

[vael-ui motion] <div class="card"> has its own CSS transition on opacity, which motion animates too: they fight. Take it out of your CSS, or set it through the motion's values.

[vael-ui motion] `after: 'titel'` names nothing that was marked; starting without waiting.

To see what moved and why, inspect the component. data-motion names the layers that set its motion, and each open and close shows on the Timings track of the Performance panel.