1.0.3 • Published 3 years ago

@zt-mobile/react-native-countdown-text v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-native-countdown-text

npm version

A React Native component that converts a timestamp of a future date to a readable countdown clock, based on a format.

Installation

npm install --save react-native-countdown-text

Usage

import React, { Component } from 'react';
import { Countdown } from 'react-native-countdown-text';

export default class App extends Component {
    render() {
        return <Countdown finishTime={1543622400} />
    }
}

Properties

NameTypeDefaultDescription
formatstring{d}:{h}:{m}:{s}The format that will be applied to the milliseconds
finishTimenumberREQUIREDThe future date timestamp
textStyleobjectThe style that will be applied to the countdown text

format examples

  • '{d} days, {h} hours, {m} minutes, {s} seconds'
  • '{h}:{m}:{s}'
  • '{d} days, {h}:{m}:{s}'
  • '{h}:{s}'