# rn-countdown-component

> A light-weight countdown component for react native.

Latest version **1.0.6** (published 2019-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-countdown-component
pnpm add rn-countdown-component
yarn add rn-countdown-component
bun add rn-countdown-component
```

## 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.6 |
| Published | 2019-01-07 |
| First published | 2019-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Bailey Granam |
| Maintainers | baileygranam |

## Links

- npm: https://www.npmjs.com/package/rn-countdown-component
- Repository: https://github.com/baileygranam/rn-countdown-component
- Homepage: https://github.com/baileygranam/rn-countdown-component#readme
- Issues: https://github.com/baileygranam/rn-countdown-component/issues
- npm.io page: https://npm.io/package/rn-countdown-component

## Dependencies (5)

- [react](https://npm.io/package/react.md) 16.5.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2
- [native-base](https://npm.io/package/native-base.md) ^2.10.0
- [react-native](https://npm.io/package/react-native.md) https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz
- [react-native-progress-circle](https://npm.io/package/react-native-progress-circle.md) ^2.0.1

## Recent versions

- 1.0.6 (latest) — 2019-01-07
- 1.0.5 — 2019-01-06
- 1.0.4 — 2019-01-03
- 1.0.3 — 2019-01-03
- 1.0.2 — 2019-01-03
- 1.0.1 — 2019-01-03
- 1.0.0 — 2019-01-03

## README

# React Native Countdown Component 
A light-weight countdown component for React Native

* [Getting Started](#getting-started)
* [Motivation](#motivation)
* [Props](#props)
* [License](#license)

## Getting Started

You can install the module via `npm`.

```
npm install rn-countdown-component --save
```

## Motivation

There is currently a lack in effective countdown timers for React Native applications. This module was designed for simplicity and to provide an easy way to implement a countdown component.

### Basic Usage
A very simple and minimal example of how to set up a countdown which counts down from 10 seconds.
```js
import React from 'react';
import Countdown from 'rn-countdown-component';

export default const CountdownApp (
  <Countdown
    seconds={10}
  />
);

```

## Props

|Name|Type|Default|Description|
|:--|:--:|:-----:|:----------|
|[**seconds**](#seconds)|`number`|`required`|Length of countdown|
|[**play**](#play)|`boolean`|`true`|Countdown auto-start option|
|[**format**](#format)|`object`|`['hours', 'minutes', 'seconds']`|Format of time displayed on countdown component|
|[**strokeColor**](#strokeColor)|`string`|`black`|Color of stroke around the progress circle|
|[**strokeWidth**](#strokeWidth) |`number`|`5`|The width in pixels of the stroke around the progress circle|
|[**radius**](#radius)|`number`|`75`|Size of the progress circle|
|[**onStart**](#onStart)|`function`|`null`|Action to perform when the countdown has been started|
|[**onPause**](#onPause)|`function`|`null`|Action to perform when the countdown has been paused|
|[**onFinish**](#onFinish)|`function`|`null`|Action to perform when the countdown has ended|

### `seconds`
The `seconds` prop is the only required one and must be a `number`. This determines the time to count down from on the timer.

Valid values can be _(and more)_:
* `'30'` -- 30 seconds
* `'60'` -- 1 Minute
* `'120'` -- 2 Minutes

### `play`
Defines whether the countdown should start automatically or not. Defaults to `true`.

### `format`
The format of the time to display on the countdown component. Allowed types are, 'hours', 'minutes', and 'seconds'.

### `strokeColor`
The `strokeColor` prop determines the color of the stroke of the progress circle. A `string` is the type.

Valid values can be _(and more)_:
* `'black'`
* `'#000'`

### `strokeWidth`
The `strokeWidth` prop determines the width of the stroke of the progress circle. A `number` is the type.

### `radius`
The `radius` prop determines the number of the stroke of the progress circle. A `number` is the type.

### `onStart`
The `onStart` prop determines the action to perform when the countdown has started. A `function` is the type.

### `onPause`
The `onPause` prop determines the action to perform when the countdown has been paused. A `function` is the type.

### `onFinish`
The `onFinish` prop determines the action to perform when the countdown has finished. A `function` is the type.

## License

MIT

[npm]: https://img.shields.io/npm/v/react-countdown-now.svg
[npm-url]: https://npmjs.com/package/react-countdown-now

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