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 commitfc6bfb108634735f1657e533206c3f8702ad357d; 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'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
endAt | string | Required | ISO timestamp when countdown expires |
durationSeconds | number | undefined | 30 | Total duration in seconds (for progress bar calculation) |
showProgress | boolean | undefined | true | Show progress bar (default true) |
warningThreshold | number | undefined | 10 | Warning threshold in seconds (default 10) |
dangerThreshold | number | undefined | 5 | Danger threshold in seconds (default 5) |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
tick | [remaining: number] | — | — |
warning | [] | — | — |
danger | [] | — | — |
expired | [] | — | — |
Exposed methods and values
| Name | Type | Required / default | Description |
|---|---|---|---|
remainingSeconds | number | — | — |
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" />',
}),
}