Skip to main content
Version: v1 (Current)

Live Countdown

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 commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

LiveCountdown​

import { LiveCountdown } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
endAtstringRequiredISO timestamp when countdown expires
durationSecondsnumber | undefined30Total duration in seconds (for progress bar calculation)
showProgressboolean | undefinedtrueShow progress bar (default true)
warningThresholdnumber | undefined10Warning threshold in seconds (default 10)
dangerThresholdnumber | undefined5Danger threshold in seconds (default 5)

Events​

NameTypeRequired / defaultDescription
tick[remaining: number]——
warning[]——
danger[]——
expired[]——

Exposed methods and values​

NameTypeRequired / defaultDescription
remainingSecondsnumber——
startTimer() => void——
stopTimer() => void——

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 LiveCountdown from './LiveCountdown.vue'
const defaultArgs = {
durationSeconds: 30,
showProgress: true,
warningThreshold: 10,
dangerThreshold: 5,
}
{
args: {
endAt: new Date(Date.now() + 30000).toISOString(),
durationSeconds: 30,
},
render: (args) => ({
components: { LiveCountdown },
setup() {
return { args }
},
template: '<LiveCountdown v-bind="args" />',
}),
}

Warning​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import LiveCountdown from './LiveCountdown.vue'
const defaultArgs = {
durationSeconds: 30,
showProgress: true,
warningThreshold: 10,
dangerThreshold: 5,
}
{
args: {
endAt: new Date(Date.now() + 8000).toISOString(),
durationSeconds: 30,
warningThreshold: 10,
dangerThreshold: 5,
},
render: (args) => ({
components: { LiveCountdown },
setup() {
return { args }
},
template: '<LiveCountdown v-bind="args" />',
}),
}

Danger​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import LiveCountdown from './LiveCountdown.vue'
const defaultArgs = {
durationSeconds: 30,
showProgress: true,
warningThreshold: 10,
dangerThreshold: 5,
}
{
args: {
endAt: new Date(Date.now() + 3000).toISOString(),
durationSeconds: 30,
dangerThreshold: 5,
},
render: (args) => ({
components: { LiveCountdown },
setup() {
return { args }
},
template: '<LiveCountdown v-bind="args" />',
}),
}