Appearance
Appearance
import Loader from '~/ui/Loader.vue'Loaders visually indicate when an operation is loading. This makes it visually clear that the user can't interact with the element until the loading process is complete.
To ensure the loader component remains accessible:
| Prop | Data type | Required? | Description |
|---|---|---|---|
overlay | Boolean | No | Cover the nearest position: relative ancestor and dim the content behind it |
NOTE
To avoid extended periods of distraction, the spinner animation stops after 4.9s.
Continuous movement is distracting for some users and not necessary to convey the ongoing loading state. A load time beyond 5s is very unlinkely and would usually indicate lost connection or an unhandled error. In either case, the user cannot expect to see results eventually, so the animated spinner would give a false impression.
By default, the loader centers itself in-place, within its own normal document flow position. It doesn't require any positioned ancestor.
<div style="width: 50%">
<Loader />
</div>Pass overlay to have the loader cover the nearest position: relative ancestor and dim the content behind it — useful when you want to keep showing stale content while it refreshes.
<div style="position: relative">
<div style="width: 50%">
<Loader overlay />
</div>
</div>