File transfer
Show known bytes transferred relative to total bytes.
Components / Display
A native progress element for determinate or indeterminate work.
Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.
bunx --bun @getweini/cli@latest add progressImport the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.
<script setup lang="ts">
import { ref } from 'vue'
import Progress from './components/ui/progress/Progress.vue'
const uploaded = ref(42)
</script>
<template>
<Progress :value="uploaded" :max="100" aria-label="Upload progress" />
<Progress :value="null" aria-label="Preparing upload" />
</template>Omit value or pass null for indeterminate progress. Supply aria-label or aria-labelledby, and use aria-valuetext when the numeric value does not express the user-facing state.
Show known bytes transferred relative to total bytes.
Show that a request is still running when completion cannot be measured.
Use a numeric value and a visible text equivalent.
<script setup lang="ts">
import { ref } from 'vue'
import Progress from './components/ui/progress/Progress.vue'
const uploaded = ref(64)
</script>
<template>
<div>
<p>Uploading files: {{ uploaded }}%</p>
<Progress :value="uploaded" :max="100" aria-label="File upload" />
</div>
</template>Pass null until the job exposes a measurable total.
<script setup lang="ts">
import Progress from './components/ui/progress/Progress.vue'
</script>
<template>
<div>
<p>Preparing report…</p>
<Progress :value="null" aria-label="Preparing report" />
</div>
</template>Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
valueprop | number | null | undefined | null | Value represented by this control or option. |
maxprop | number | undefined | 100 | Largest allowed value. |
sizeprop | "sm" | "md" | "lg" | undefined | "md" | Choose the visual size. Medium is the usual default where available. |
variantprop | "default" | "success" | "warning" | "destructive" | undefined | "default" | Choose the visual treatment for this component. |
elementexposed | HTMLProgressElement | null | — | Reference to the underlying HTML element. |
// packages/frameworks/vue/components/progress/types.ts
// ------- IMPORTS -------
import type { progressSizes, progressVariants } from './styles'
// ------- TYPES -------
export interface ProgressProps {
value?: number | null
max?: number
size?: keyof typeof progressSizes
variant?: keyof typeof progressVariants
}
// packages/frameworks/vue/components/progress/styles.ts
// Change Progress track height and fill colors here; public visual types follow these keys.
export const progressSizes = { sm: 'h-1', md: 'h-2', lg: 'h-3' } as const
export const progressVariants = {
default: '[&::-moz-progress-bar]:bg-primary [&::-webkit-progress-value]:bg-primary',
success: '[&::-moz-progress-bar]:bg-success [&::-webkit-progress-value]:bg-success',
warning:
'[&::-moz-progress-bar]:bg-warning-indicator [&::-webkit-progress-value]:bg-warning-indicator',
destructive: '[&::-moz-progress-bar]:bg-destructive [&::-webkit-progress-value]:bg-destructive',
} as const