webtransfer/src/components/ProgressBar.vue

36 lines
733 B
Vue
Raw Normal View History

2024-11-22 17:00:53 +01:00
<template>
2024-11-22 17:26:04 +01:00
<div class="flex items-center w-48 h-full">
<div class="relative w-full h-2 bg-gray-200/10 rounded-full overflow-hidden">
<div :style="{ width: value + '%' }" class="h-full rounded-full" :class="color"></div>
2024-11-22 17:00:53 +01:00
</div>
2024-11-22 17:26:04 +01:00
</div>
</template>
<script>
export default {
name: "ProgressBar",
props: {
value: {
type: Number,
required: true,
2024-11-22 17:00:53 +01:00
},
2024-11-22 17:26:04 +01:00
label: {
type: String,
default: "Progress",
2024-11-22 17:24:33 +01:00
},
2024-11-22 17:26:04 +01:00
color: {
type: String,
default: "bg-blue-500",
},
},
computed: {
clampedValue() {
return Math.max(0, Math.min(this.value, 100));
},
},
};
</script>
<style scoped>
/* Optionnel: Ajoutez un style personnalisé ici si nécessaire */
</style>