Component
Vue Spinner Component
<DomSpinner>A compact loading indicator for buttons, toolbars, inline rows, and pending states.
Spinner styles and sizes
Set variant="tail" to fade the rotating highlight into the ring. The default arc variant uses a solid highlight. Both variants support sm, md, and lg sizes and respect reduced-motion preferences.
- Small
- Medium
- Large
Loading on a dark surface
foreground sets the highlight and background sets the ring track. Leave background unset to use a faint tint of the highlight. Use label to describe what is loading when the spinner provides the status on its own.
Starting your preview
Your preview will open when it’s ready.
Playground
Spinner playground
Properties
Control props
Screen reader label.
Spinner size.
Use a solid arc or a highlight with a fading tail.
Spinner foreground colour when no custom foreground is provided.
CSS color for the stationary donut track. Defaults to a tint of the foreground.
CSS color for the spinning arc. Overrides tone when provided.
npm install @getdom/studio<script setup>
import '@getdom/studio/style.css';
import { reactive } from 'vue';
import { DomSpinner } from '@getdom/studio';
const data = reactive({
"label": "Saving",
"size": "md",
"variant": "tail",
"tone": "primary",
"background": "",
"foreground": ""
});
</script>
<template>
<DomSpinner
v-bind="data"
/>
</template>Reference
Props
Control props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
label | string | string | 'Loading' | Screen reader label. |
size | 'sm' | 'md' | 'lg' | string | 'md' | Spinner size. |
variant | 'arc' | 'tail' | string | 'arc' | Use a solid arc or a highlight with a fading tail. |
tone | 'primary' | 'neutral' | 'success' | 'warning' | 'danger' | string | 'primary' | Spinner foreground colour when no custom foreground is provided. |
background | string | string | '' | CSS color for the stationary donut track. Defaults to a tint of the foreground. |
foreground | string | string | '' | CSS color for the spinning arc. Overrides tone when provided. |
Auto-generated from Spinner.props and inline _edit hints.