Countdown Timer
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.
CountdownTimer
import { CountdownTimer } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
totalTime | number | Required | Total time in seconds |
initialRemaining | number | undefined | — | Override remaining time (for server sync) |
warningThreshold | number | undefined | 25 | Percentage threshold for warning state (default 25) |
dangerThreshold | number | undefined | 10 | Percentage threshold for danger state (default 10) |
showProgress | boolean | undefined | true | Show progress bar (default true) |
showLabel | boolean | undefined | true | Show "remaining" label (default true) |
paused | boolean | undefined | false | Pause the timer |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
timeout | [] | — | — |
tick | [remaining: number] | — | — |
warning | [] | — | — |
danger | [] | — | — |
Exposed methods and values
| Name | Type | Required / default | Description |
|---|---|---|---|
startTimer | () => void | — | — |
stopTimer | () => void | — | — |
resetTimer | () => void | — | — |
getTimeRemaining | () => number | — | — |
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 CountdownTimer from './CountdownTimer.vue'
const defaultArgs = {
totalTime: 60,
warningThreshold: 25,
dangerThreshold: 10,
showProgress: true,
showLabel: true,
paused: false,
}
{
args: {
totalTime: 60,
},
render: (args) => ({
components: { CountdownTimer },
setup() {
return { args }
},
template: '<CountdownTimer v-bind="args" />',
}),
}
LongTimer
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import CountdownTimer from './CountdownTimer.vue'
const defaultArgs = {
totalTime: 60,
warningThreshold: 25,
dangerThreshold: 10,
showProgress: true,
showLabel: true,
paused: false,
}
{
args: {
totalTime: 300,
},
render: (args) => ({
components: { CountdownTimer },
setup() {
return { args }
},
template: '<CountdownTimer v-bind="args" />',
}),
}
Warning
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import CountdownTimer from './CountdownTimer.vue'
const defaultArgs = {
totalTime: 60,
warningThreshold: 25,
dangerThreshold: 10,
showProgress: true,
showLabel: true,
paused: false,
}
{
args: {
totalTime: 60,
initialRemaining: 15,
},
render: (args) => ({
components: { CountdownTimer },
setup() {
return { args }
},
template: '<CountdownTimer v-bind="args" />',
}),
}