Progress circular VProgressCircular displays task progress as a ring, or an animation when progress cannot be measured.
Usage 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.
40% 58%
-25 +25 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.
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.
<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.
<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.
<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.
<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.
<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 Slots Types Types used in the API tables. Import exported types from vectis-ui.
export interface ProgressCircularSlotProps {
value: number
max: number
percent: number
} CSS variables