# @kitsuyui/react-timer

> A react component to display a timer

Latest version **0.2.1** (published 2026-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kitsuyui/react-timer
pnpm add @kitsuyui/react-timer
yarn add @kitsuyui/react-timer
bun add @kitsuyui/react-timer
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2026-03-09 |
| First published | 2023-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 515.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Yui Kitsu |
| Maintainers | kitsuyui |

## Links

- npm: https://www.npmjs.com/package/@kitsuyui/react-timer
- Repository: https://github.com/kitsuyui/react-playground
- Homepage: https://github.com/kitsuyui/react-playground#readme
- Issues: https://github.com/kitsuyui/react-playground/issues
- npm.io page: https://npm.io/package/@kitsuyui/react-timer

## Recent versions

- 0.2.1 (latest) — 2026-03-09
- 0.2.0 — 2025-06-17
- 0.1.7 — 2024-12-09
- 0.1.6 — 2024-07-22
- 0.1.5 — 2024-07-12
- 0.1.4 — 2024-05-04
- 0.1.3 — 2024-05-04
- 0.1.2 — 2024-03-29
- 0.1.1 — 2024-03-25
- 0.1.0 — 2024-01-25
- 0.0.33 — 2023-12-04
- 0.0.32 — 2023-11-13
- 0.0.31 — 2023-11-10
- 0.0.30 — 2023-11-09
- 0.0.29 — 2023-10-29
- … 20 more at https://npm.io/package/@kitsuyui/react-timer/versions

## README

# @kitsuyui/react-timer

[![npm version](https://badge.fury.io/js/@kitsuyui%2Freact-timer.svg)](https://badge.fury.io/js/@kitsuyui%2Freact-timer)

Simple timer React component.

## Demo

Storybook: https://react-playground.docs.kitsuyui.com/storybook/

## Installation

### npm

```sh
npm install @kitsuyui/react-timer
```

### yarn

```sh
yarn add @kitsuyui/react-timer
```

### pnpm

```sh
pnpm add @kitsuyui/react-timer
```

## Usage

```tsx
import { TimerContainer, MinimalTimer } from '@kitsuyui/react-timer'

const Timer = () => {
  return (
    <TimerContainer>
      <TimerContext.Consumer>
        {(timer: TimerProps) => <MinimalTimer {...timer} />}
      </TimerContext.Consumer>
    </TimerContainer>
  )
}
```

TimerContainer is a component that provides TimerContext.
Timers are pure components that do not depend on TimerContext. Accept TimerProps as props.
So you can define your own Timer component by same interface.

```typescript
export interface TimerValue {
  remaining: number
  running: boolean
}

export interface TimerActions {
  start(): void
  stop(): void
  toggle(): void
  reset(): void
  incrementTimerValue(value: number): void
  setTimerValue(value: number): void
}

export type TimerProps = TimerValue & TimerActions
```

## License

MIT

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