# react-countdown-rp

> A render props component that counts down

Latest version **1.0.7** (published 2019-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-countdown-rp
pnpm add react-countdown-rp
yarn add react-countdown-rp
bun add react-countdown-rp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-02-26 |
| First published | 2019-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Trevor Blades |
| Maintainers | trevorblades |
| Keywords | react, countdown, render-props, timer, component |

## Links

- npm: https://www.npmjs.com/package/react-countdown-rp
- Repository: https://github.com/trevorblades/react-countdown-rp
- Homepage: https://github.com/trevorblades/react-countdown-rp#readme
- Issues: https://github.com/trevorblades/react-countdown-rp/issues
- npm.io page: https://npm.io/package/react-countdown-rp

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2019-02-26
- 1.0.6 — 2019-02-18
- 1.0.5 — 2019-02-18
- 1.0.4 — 2019-02-15
- 1.0.3 — 2019-02-15
- 1.0.2 — 2019-02-15
- 1.0.0 — 2019-02-15

## README

# react-countdown-rp

A React render prop component that counts down from *now* to a future time

## Installation

```bash
$ npm install react-countdown-rp
```

## Usage

Specify a future time (in milliseconds) in the `endsAt` prop. The countdown will stop once it reaches 0. The `children` function is passed `secondsRemaining` and `msRemaining` numbers that you can use to render elements.

```js
import Countdown from 'react-countdown-rp';

// 10 second countdown
<Countdown endsAt={Date.now() + 10000}>
  {({secondsRemaining, msRemaining}) => (
    <div>
      <h1>{secondsRemaining}</h1>
      <h3>{msRemaining}</h3>
    </div>
  )}
</Countdown>
```

## Props

| Name          | Type       | Required | Description                                                               |
| ------------- | ---------- | -------- | ------------------------------------------------------------------------- |
| `endsAt`      | `Number`   | yes      | Millseconds representing the end date (e.g. `date.getTime()`)             |
| `children`    | `Function` | yes      | Called with object `{secondsRemaining, msRemaining}` as the only argument |
| `onCompleted` | `Function` | no       | Fired when the countdown reaches 0                                        |

---
_Source: https://npm.io/package/react-countdown-rp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
