Keyboard shortcut: Ctrl + K
Get started

Progress circular

VProgressCircular displays task progress as a ring, or an animation when progress cannot be measured.

Usage

vue
65%
<script setup lang="ts">
import { VProgressCircular } from 'vectis-ui'
</script>

<template>
  <VProgressCircular :value="65" label="Upload" show-value />
</template>

Examples

Value

Set value and max to report progress. Values are clamped to the range.

vue
40%58%

value = 40, max = 100

<script setup lang="ts">
import { ref } from 'vue'
import { VButton, VProgressCircular, VTypography } from 'vectis-ui'

const value = ref(40)
const step = (delta: number) => (value.value += delta)
</script>

<template>
  <div class="column">
    <div class="row">
      <VProgressCircular :value="value" :size="96" show-value label="Upload" />

      <VProgressCircular :value="7" :max="12" :size="96" show-value label="Files" />
    </div>

    <div class="row">
      <VButton variant="outline" tone="neutral" size="sm" @click="step(-25)">-25</VButton>
      <VButton variant="outline" tone="neutral" size="sm" @click="step(25)">+25</VButton>
      <VTypography variant="body-sm" tone="muted">value = {{ value }}, max = 100</VTypography>
    </div>
  </div>
</template>

<style scoped>
.column {
  display: grid;
  gap: var(--vectis-space-5);
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vectis-space-6);
}
</style>

Indeterminate

indeterminate animates the ring without a percentage. Use VSpinner for an icon-sized loading indicator.

vue

For a server that reports no percentage. Where a spinner would stand in for an icon, VSpinner is the smaller thing to reach for.

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

<template>
  <div class="column">
    <div class="row">
      <VProgressCircular indeterminate label="Waiting for the server" />
      <VProgressCircular indeterminate :size="64" tone="neutral" label="Loading" />
      <VProgressCircular indeterminate :size="64" :thickness="10" label="Working" />
    </div>

    <VTypography variant="body-sm" tone="muted">
      For a server that reports no percentage. Where a spinner would stand in for an icon, VSpinner
      is the smaller thing to reach for.
    </VTypography>
  </div>
</template>

<style scoped>
.column {
  display: grid;
  gap: var(--vectis-space-5);
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vectis-space-6);
}
</style>

Tones

tone sets the semantic colour.

vue

accent

success

warning

danger

neutral

<script setup lang="ts">
import { VProgressCircular, VTypography, type ProgressCircularTone } from 'vectis-ui'

const TONES: ProgressCircularTone[] = ['accent', 'success', 'warning', 'danger', 'neutral']
</script>

<template>
  <div class="row">
    <div v-for="tone in TONES" :key="tone" class="cell">
      <VProgressCircular :value="65" :tone="tone" :label="`Upload, ${tone}`" />
      <VTypography variant="caption" tone="muted">{{ tone }}</VTypography>
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vectis-space-6);
}
.cell {
  display: grid;
  justify-items: center;
  gap: var(--vectis-space-2);
}
</style>

Custom colours

color overrides the tone with a CSS colour.

vue

A hex value

A CSS colour name

An oklch() colour

<script setup lang="ts">
import { VProgressCircular, VTypography } from 'vectis-ui'

const COLORS = [
  { value: '#7c3aed', caption: 'A hex value' },
  { value: 'teal', caption: 'A CSS colour name' },
  { value: 'oklch(0.72 0.19 45)', caption: 'An oklch() colour' },
]
</script>

<template>
  <div class="row">
    <div v-for="colour in COLORS" :key="colour.value" class="cell">
      <VProgressCircular :value="65" :color="colour.value" :label="`Upload, ${colour.caption}`" />
      <VTypography variant="caption" tone="muted">{{ colour.caption }}</VTypography>
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vectis-space-6);
}
.cell {
  display: grid;
  justify-items: center;
  gap: var(--vectis-space-2);
}
</style>

Size and thickness

size sets the diameter and thickness sets the stroke width, both in pixels.

vue

24px

40px

64px

96px

2px ring

4px ring

8px ring

14px ring

<script setup lang="ts">
import { VProgressCircular, VTypography } from 'vectis-ui'

const SIZES = [24, 40, 64, 96]
const THICKNESSES = [2, 4, 8, 14]
</script>

<template>
  <div class="column">
    <div class="row">
      <div v-for="size in SIZES" :key="size" class="cell">
        <VProgressCircular :value="65" :size="size" :label="`Upload, ${size}px`" />
        <VTypography variant="caption" tone="muted">{{ size }}px</VTypography>
      </div>
    </div>

    <div class="row">
      <div v-for="thickness in THICKNESSES" :key="thickness" class="cell">
        <VProgressCircular
          :value="65"
          :size="64"
          :thickness="thickness"
          :label="`Upload, ${thickness}px ring`"
        />
        <VTypography variant="caption" tone="muted">{{ thickness }}px ring</VTypography>
      </div>
    </div>
  </div>
</template>

<style scoped>
.column {
  display: grid;
  gap: var(--vectis-space-6);
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--vectis-space-6);
}
.cell {
  display: grid;
  justify-items: center;
  gap: var(--vectis-space-2);
}
</style>

Shape

shape selects rounded or square stroke ends.

vue

rounded, the default

square

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

<template>
  <div class="row">
    <div class="cell">
      <VProgressCircular :value="65" :size="96" :thickness="14" label="Upload, rounded" />
      <VTypography variant="caption" tone="muted">rounded, the default</VTypography>
    </div>

    <div class="cell">
      <VProgressCircular
        :value="65"
        :size="96"
        :thickness="14"
        shape="square"
        label="Upload, square"
      />
      <VTypography variant="caption" tone="muted">square</VTypography>
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vectis-space-6);
}
.cell {
  display: grid;
  justify-items: center;
  gap: var(--vectis-space-2);
}
</style>

Content in the middle

showValue displays the percentage at the centre. The default slot replaces it and receives value, max and percent.

vue
65%

showValue

7/12

A count

An icon

<script setup lang="ts">
import { VIcon, VProgressCircular, VTypography } from 'vectis-ui'
import { check } from 'vectis-ui/icons'
</script>

<template>
  <div class="row">
    <div class="cell">
      <VProgressCircular :value="65" :size="96" show-value label="Upload" />
      <VTypography variant="caption" tone="muted">showValue</VTypography>
    </div>

    <div class="cell">
      <VProgressCircular :value="7" :max="12" :size="96" label="Files uploaded">
        <template #default="{ value, max }">
          <span class="count">{{ value }}/{{ max }}</span>
        </template>
      </VProgressCircular>
      <VTypography variant="caption" tone="muted">A count</VTypography>
    </div>

    <div class="cell">
      <VProgressCircular :value="100" :size="96" tone="success" label="Upload finished">
        <VIcon :name="check" :size="32" />
      </VProgressCircular>
      <VTypography variant="caption" tone="muted">An icon</VTypography>
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vectis-space-6);
}
.cell {
  display: grid;
  justify-items: center;
  gap: var(--vectis-space-2);
}
.count {
  font-variant-numeric: tabular-nums;
}
</style>

API

Props

PropTypeDefault
valuenumber0
Progress value, clamped between 0 and max.
labelstringnone
Accessible task name. Defaults to the dictionary; consumer ARIA naming attributes take precedence.
maxnumber100
Value representing completion.
indeterminatebooleanfalse
Animates without a measurable value. Ignores value.
toneProgressCircularTone'neutral' | 'accent' | 'danger' | 'success' | 'warning''accent'
Colour tone.
colorstringnone
Custom CSS colour overriding the tone.
sizenumber | stringnone
Ring diameter in pixels, as a number or numeric string.
thicknessnumber | stringnone
Stroke thickness in pixels, as a number or numeric string.
shapeProgressCircularShape'rounded' | 'square''rounded'
Rounded or square stroke ends.
showValuebooleanfalse
Displays the percentage. Ignored in indeterminate mode.

Slots

SlotType
defaultProgressCircularSlotProps
Centre content replacing the percentage. Receives value, max and percent.

Types

Types used in the API tables. Import exported types from vectis-ui.

export interface ProgressCircularSlotProps {
  value: number
  max: number
  percent: number
}

CSS variables

TokenValue
--vectis-control-size-progress-circular-diameter3rem
--vectis-control-size-progress-circular-thickness0.25rem