Progress
Generated from public Vue/TypeScript exports by
pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
Progress
import { Progress } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
modelValue | number | null | undefined | 0 | The progress value. Can be bind as v-model. |
max | number | undefined | — | The maximum progress value. |
getValueLabel | ((value: number | null | undefined, max: number) => string | undefined) | undefined | — | 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 | undefined, max: number) => string | undefined) | undefined | — | A function to get the accessible value text representing the current value in a human-readable format. |
asChild | boolean | undefined | — | 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 | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Examples
These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref, onMounted, onUnmounted } from 'vue'
import { Progress } from '.'
const defaultArgs = {
modelValue: 50,
}
{
render: (args) => ({
components: { Progress },
setup() {
return { args }
},
template: '<Progress v-bind="args" />',
}),
}
WithValues
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref, onMounted, onUnmounted } from 'vue'
import { Progress } from '.'
const defaultArgs = {
modelValue: 50,
}
{
name: 'With Values',
render: () => ({
components: { Progress },
template: `
<div class="space-y-4 w-80">
<div>
<p class="text-sm text-muted-foreground mb-2">25%</p>
<Progress :model-value="25" />
</div>
<div>
<p class="text-sm text-muted-foreground mb-2">50%</p>
<Progress :model-value="50" />
</div>
<div>
<p class="text-sm text-muted-foreground mb-2">75%</p>
<Progress :model-value="75" />
</div>
<div>
<p class="text-sm text-muted-foreground mb-2">100%</p>
<Progress :model-value="100" />
</div>
</div>
`,
}),
}
Animated
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref, onMounted, onUnmounted } from 'vue'
import { Progress } from '.'
const defaultArgs = {
modelValue: 50,
}
{
name: 'Animated',
render: () => ({
components: { Progress },
setup() {
const value = ref(0)
let interval: ReturnType<typeof setInterval>
onMounted(() => {
interval = setInterval(() => {
value.value = value.value >= 100 ? 0 : value.value + 5
}, 200)
})
onUnmounted(() => {
clearInterval(interval)
})
return { value }
},
template: `
<div class="w-80">
<p class="text-sm text-muted-foreground mb-2">{{ value }}%</p>
<Progress :model-value="value" />
</div>
`,
}),
}