Countdown component for your Nuxt App.
npm install nuxt-countdown[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]
A countdown module for multi purpose usage written for Nuxt 3 and 4.
- Nuxt 3 and 4 Support
- Autoimport
- Less config
While we're preparing detailed documentation and playground, you can check the examples below.
1. Add nuxt-countdown dependency to your project
``bashUsing yarn
yarn add nuxt-countdown
2. Add
nuxt-countdown to the modules section of nuxt.config.ts`js
export default defineNuxtConfig({
modules: [
'nuxt-countdown'
]
})
`That's it! You can now use Countdown Component in your Nuxt app ✨
Examples
When you add this module, the
`` component will be automatically imported into the project.$3
With
`:date` prop, you can set the target date for countdown.Then you can use slot props to show the countdown values in
`days`, `hours`, `minutes`, `seconds` or `milliseconds`. (`milliseconds` is available for custom interval)`js
:date="new Date('Oct 19, 2026 16:50:30')"
v-slot="{ days, hours, minutes, seconds }"
>
Time Remaining: {{ days }} days, {{ hours }} hours,
{{ minutes }} minutes, {{ seconds }} seconds.
`$3
With
`:time` prop, you can set the target time in milliseconds for countdown.`js
:time="2 24 60 60 1000"
v-slot="{ days, hours, minutes, seconds }"
>
Time Remaining:{{ days }} days, {{ hours }} hours, {{ minutes }} minutes, {{ seconds }} seconds.
`$3
You can set custom interval time value for update countdown values with
`:interval` prop, value in milliseconds.`js
:time="time"
:interval="100"
v-slot="{ days, hours, minutes, seconds, milliseconds }"
>
New Year Countdown:{{ days }} days, {{ hours }} hours,
{{ minutes }} minutes, {{ seconds }}.{{ Math.floor(milliseconds / 100) }}
seconds.