<BaseProgress /> · A progression indicator element.
<template>
<BaseProgress
v-model="progress"
title="Progress bar"
/>
</template>
<script setup lang="ts">
const progress = ref(25)
</script>
This component is self closing and can be used to create an animated progress bar.
<template>
<BaseProgress />
</template>
This component has props that you can use to modify its visual style.
| Model | Type |
|---|---|
model-value | number | nullThe progress value. Can be bind as `v-model`. |
| Prop | Type |
|---|---|
variantdefault: "default" | "default" | "primary" | "dark" | "none"The variant of the progress bar. |
roundeddefault: "full" | "none" | "md" | "sm" | "lg" | "full"The radius of the progress bar. |
sizedefault: "sm" | "md" | "xs" | "sm" | "lg" | "xl"The size of the progress bar. |
maxdefault: - | numberThe maximum progress value. |
get-value-labeldefault: - | ((value: number, max: number) => string)A function to get the accessible label text representing the current value in a human-readable format. If not provided, the value label will be read as the numeric value as a percentage of the max value. |
as-childdefault: - | booleanChange the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details. |
asdefault: - | AsTag | ComponentThe element or component this component should render as. Can be overwritten by `asChild`. |
| Event | Emitted Value Type |
|---|---|
update:max | [value: number] |
| Slot | Type |
|---|---|
#default | any |
Your can override the component default CSS variables in your main.css file.
@theme {
/* Default progress bar variables */
--color-track-default-bg: var(--color-muted-200);
--color-track-default-bg-active: var(--color-muted-500);
--color-track-default-bg-invert: var(--color-white);
--color-track-default-handle-bg: var(--color-white);
--color-track-default-handle-border: var(--color-muted-300);
--color-track-default-handle-ring: var(--color-track-default-bg-active);
/* Dark progress bar variables */
--color-track-dark-bg: var(--color-muted-200);
--color-track-dark-bg-active: var(--color-muted-900);
--color-track-dark-bg-invert: var(--color-white);
--color-track-dark-handle-bg: var(--color-white);
--color-track-dark-handle-border: var(--color-muted-300);
--color-track-dark-handle-ring: var(--color-track-dark-bg-active);
}
Use the value prop to set the value of the progress bar.
<template>
<BaseProgress
v-model="progress"
title="Dynamic progress bar"
/>
</template>
<script setup lang="ts">
const progress = ref(76)
</script>
Omit the value prop to set the progress bar in an indeterminate state.
<template>
<BaseProgress title="Indeterminate progress bar" />
</template>
Use the size prop to change the size of the progress bar.
<template>
<BaseProgress
v-model="progress"
title="Medium progress bar"
size="md"
/>
</template>
<script setup lang="ts">
const progress = ref(76)
</script>
Use the variant prop to change the color of the progress bar. Set it to none to remove the default color and apply your own.
<template>
<BaseProgress
v-model="progress"
title="Custom progress bar"
size="sm"
variant="none"
class="bg-muted-200 dark:bg-muted-900 *:first:bg-yellow-400"
/>
</template>
<script setup lang="ts">
const progress = ref(76)
</script>