Menampilkan indikator kemajuan sebuah proses, biasanya berbentuk bilah progres.
Installation
pnpm dlx kliping@latest add progressPasang dependensi berikut:
pnpm add reka-uiSalin dan tempel kode sumber di GitHub ke project Anda.
Sesuaikan path import dengan struktur project Anda.
Usage
vue
<script setup lang="ts">
import { Progress } from '@/components/ui/progress'
</script>
<template>
<Progress :model-value="33" />
</template>1
2
3
4
5
6
7
2
3
4
5
6
7
Requirements
Semua dipasang otomatis oleh kliping add; tabel ini untuk Anda yang memasang manual atau memeriksa project.
| Requirement | Value |
|---|---|
| Project | Vue 3.5+, Tailwind CSS v4, alias @ — disiapkan kliping init |
| npm packages | @vueuse/core@^14.4.0, reka-ui@^2.10.3 |
| Files | components/ui/progress/progress.vuecomponents/ui/progress/index.ts |
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue? | number | 0 | The progress value. Can be bind as v-model. |
max? | number | — | The maximum progress value. |
getValueLabel? | ((value: number | null, max: number) => string) | — | A function to get the accessible label text 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. |
getValueText? | ((value: number | null, max: number) => string) | — | A function to get the accessible value text representing the current value in a human-readable format. |
asChild? | boolean | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as? | AsTag | Component | — | The element or component this component should render as. Can be overwritten by asChild. |
| Data attribute | Value |
|---|---|
[data-slot] | "progress" |
CSS Variables
Token tema yang dibaca komponen ini — ubah nilainya di CSS global (:root dan .dark, lihat Theming) untuk mengubah tampilannya tanpa menyentuh komponennya: --primary.
Credits
Berasal dari shadcn-vue (MIT, Copyright (c) 2023 unovue). Rantai lengkapnya di Credits.