Cài đặt
Chạy lệnh này trong app, sau shadcn-vue init và theme Beehexa (Button › Code):
npx shadcn-vue@latest add https://beehexa.design/r/progress.json
Cách dùng
<script setup lang="ts">
import { Progress } from '@/components/ui/progress'
</script>
<template>
<Progress :model-value="64" aria-label="Tiến độ nhập" />
</template>
Prop
| Prop | Giá trị | Ghi chú |
|---|---|---|
modelValue |
số, null |
Phần trăm đã làm, 0 tới 100 (mặc định 0) |
max |
số | Mặc định 100 |
getValueLabel |
hàm | Chữ được đọc cho giá trị, như “640 / 1.000” |
aria-label, aria-labelledby |
chuỗi | Bắt buộc: tên của thanh |
Dựng từ
Bọc Progress của reka-ui theo API Progress của shadcn-vue. reka-ui lo role="progressbar" và aria-valuenow, aria-valuemin, aria-valuemax. Beehexa thêm style.