Keyboard shortcut: Ctrl + K
Get started

Spinner

VSpinner indicates an ongoing operation and fits in an icon-sized space.

Usage

vue
Loading…
<script setup lang="ts">
import { VSpinner } from 'vectis-ui'
</script>

<template>
  <VSpinner />
</template>

Examples

Sizes

size sets the box size in pixels. Defaults to 1em.

vue

Loading… Follows small text

Loading… Follows large text

Loading… 32 pixels, whatever the text does

<script setup lang="ts">
import { VSpinner } from 'vectis-ui'
</script>

<template>
  <div class="demo">
    <p class="small"><VSpinner /> Follows small text</p>
    <p class="large"><VSpinner /> Follows large text</p>

    <p><VSpinner :size="32" /> 32 pixels, whatever the text does</p>
  </div>
</template>

<style scoped>
.demo {
  display: grid;
  gap: var(--vectis-space-4);
}
.demo p {
  display: flex;
  align-items: center;
  gap: var(--vectis-space-3);
  margin: 0;
}
.small {
  font-size: var(--vectis-text-body-sm-size);
}
.large {
  font-size: var(--vectis-text-heading-3-size);
}
</style>

Colour

The spinner uses currentcolor and inherits the text colour.

vue

Loading… The colour of the text it sits in

Sending Sending

Retrying Retrying

<script setup lang="ts">
import { VSpinner } from 'vectis-ui'
</script>

<template>
  <div class="demo">
    <p><VSpinner /> The colour of the text it sits in</p>
    <p class="accent"><VSpinner label="Sending" /> Sending</p>
    <p class="danger"><VSpinner label="Retrying" /> Retrying</p>
  </div>
</template>

<style scoped>
.demo {
  display: grid;
  gap: var(--vectis-space-3);
}
.demo p {
  display: flex;
  align-items: center;
  gap: var(--vectis-space-3);
  margin: 0;
}
.accent {
  color: var(--vectis-color-accent-text);
}
.danger {
  color: var(--vectis-color-danger-text);
}
</style>

In place of an icon

Use the same size as an icon to replace it with a spinner.

vue

Searching the archive

Loading… Searching the archive

Loading…
<script setup lang="ts">
import { VButton, VIcon, VInput, VSpinner } from 'vectis-ui'
import { search } from 'vectis-ui/icons'
</script>

<template>
  <div class="demo">
    <p><VIcon :name="search" /> Searching the archive</p>
    <p><VSpinner /> Searching the archive</p>

    <VButton class="control" loading>Saving</VButton>
    <VInput class="control" label="Reference" model-value="INV-2481" loading />
  </div>
</template>

<style scoped>
.demo {
  display: grid;
  justify-items: start;
  gap: var(--vectis-space-4);
}
.demo p {
  display: flex;
  align-items: center;
  gap: var(--vectis-space-3);
  margin: 0;
}
.control {
  inline-size: 14rem;
}
</style>

API

Props

PropTypeDefault
sizenumber | stringnone
Box size in pixels, as a number or numeric string. Defaults to 1em.
labelstringnone
Accessible loading text. Defaults to the library dictionary.