Skip to main content
Version: v1 (Current)

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.

Countdown​

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

Repository source

Props​

NameTypeRequired / defaultDescription
timeoutLengthnumber | undefined30—
ignoreTimeoutboolean | undefinedfalse—
showProgressboolean | undefinedfalseShow the visual progress bar that fills as the idle countdown elapses. Off by default (code-only — no dashboard/form field); the countdown timeout still runs and emits regardless of this flag.

Events​

NameTypeRequired / defaultDescription
countdown-completed[]——

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 Countdown from './Countdown.vue'
const defaultArgs = {
timeoutLength: 30,
ignoreTimeout: false,
}
{
render: (args) => ({
components: { Countdown },
setup() {
return { args }
},
template: `
<div>
<Countdown v-bind="args" @countdown-completed="onCompleted" />
<p class="text-sm text-muted-foreground mt-4">
The progress bar is fixed at the top of the viewport. Timeout: {{ args.timeoutLength }}s.
Interact with the page to reset the timer.
</p>
</div>
`,
methods: {
onCompleted() {
console.log('countdown-completed emitted')
},
},
}),
}

ShortTimeout​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import Countdown from './Countdown.vue'
const defaultArgs = {
timeoutLength: 30,
ignoreTimeout: false,
}
{
args: {
timeoutLength: 5,
},
render: (args) => ({
components: { Countdown },
setup() {
return { args }
},
template: `
<div>
<Countdown v-bind="args" @countdown-completed="onCompleted" />
<p class="text-sm text-muted-foreground mt-4">
Short timeout (5s). Stop interacting with the page and the countdown-completed event
will fire after 5 seconds. Check the Actions panel to see emitted events.
</p>
</div>
`,
methods: {
onCompleted() {
console.log('countdown-completed emitted')
},
},
}),
}

Disabled​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import Countdown from './Countdown.vue'
const defaultArgs = {
timeoutLength: 30,
ignoreTimeout: false,
}
{
args: {
timeoutLength: 30,
ignoreTimeout: true,
},
render: (args) => ({
components: { Countdown },
setup() {
return { args }
},
template: `
<div>
<Countdown v-bind="args" />
<p class="text-sm text-muted-foreground mt-4">
Countdown is disabled (ignoreTimeout: true). The progress bar is still visible but
no timer is running and no events will be emitted.
</p>
</div>
`,
}),
}