Feedback
Layout
Loader
A small spinner in five styles that sizes to the text around it. Use it to show that something is in progress.
Install
import { Loader } from 'vael-ui'Playground
ConfigProvider's loader-type sets every loader in an app at once, the ones inside buttons, lists and toasts too.
1rem
Placement, behaviour and animation
undefined
Usage
<script setup lang="ts">
import { Loader } from 'vael-ui'
</script>
<template>
<Loader size="1rem" />
</template>Motion New
Loader: its appearance; false holds it still.
<Loader
:motion="{ initial: { root: { opacity: 0, y: 4 } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | root | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- Without
label, it isaria-hidden, so pair it with visible text or a busy state on what it stands for. - With
label, it rendersrole="status"named by visually hidden text, so screen readers announce it. - Under reduced motion, the built-in animations pulse instead of spinning.