# react-time-knob

> HTML5 Canvas-based React knob/dial time display

Latest version **0.1.4** (published 2017-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-time-knob
pnpm add react-time-knob
yarn add react-time-knob
bun add react-time-knob
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2017-12-30 |
| First published | 2017-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kaelan Mikowicz |
| Maintainers | klanmiko |
| Keywords | react, canvas, knob, dial, time |

## Links

- npm: https://www.npmjs.com/package/react-time-knob
- Repository: https://github.com/klanmiko/react-time-knob
- Homepage: https://github.com/klanmiko/react-time-knob#readme
- Issues: https://github.com/klanmiko/react-time-knob
- npm.io page: https://npm.io/package/react-time-knob

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## 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

- 0.1.4 (latest) — 2017-12-30
- 0.1.3 — 2017-12-30
- 0.1.2 — 2017-12-28
- 0.1.0 — 2017-12-28

## README

# react-time-knob

[jQuery Knob](https://github.com/aterrien/jQuery-Knob) rebuilt with React (no jQuery). This is an HTML5 Canvas-based component that serves as a circular time display with three rings to display the hours, seconds, and minutes given in its props.

## Installation
`npm install react-time-knob --save`

## Example usage

```js
import React from 'react';
import Knob from 'react-time-knob';

class MyComponent extends React.Component {
  state = {hours: 1, minutes: 24, seconds: 14};
  render() {
    return (
      <Knob
        hours={this.state.hours}
        minutes={this.state.minutes}
        seconds={this.state.seconds}
      />
    );
  }
}
```

## Properties
| name | description | default |
|------|-------------|---------|
|`hours`| hours to display | `0` |
|`minutes`| minutes to display | `0` |
|`seconds`| seconds to display | `0` |
|`width` or `height`|dimension of square (px)|`200`|
|`thickness`|gauge thickness in percent of width |`0.35`|
|`lineCap`|gauge stroke ending style (`butt` or `round`)|`'butt'`|
|`bgColor`|background color|`'#EEE'`|
|`sColor`|second ring color|`'#EA2'`|
|`mColor`|minute ring color|`'#EA2'`|
|`hColor`|hour ring color|`'#EA2'`|
|`inputColor`|text color|`fgColor`|
|`font`|font family|`'Arial'`|
|`fontWeight`|font weight|`'bold'`|
|`clockwise`|direction of progression|`true`|
|`cursor`|use cursor display mode - give width value or `true` which uses the default cursor width (30)|`false`|
|`displayCustom`|function that will render your custom component in the centre. (Make sure to set `displayInput` as `false`, as that takes priority)|n/a|
|`angleArc`|arc size in degrees|`360`|
|`angleOffset`|starting angle in degrees|`0`|
|`title`|adds title attribute to the wheel|`value`|
|`className`|custom className to be applied to the container element|`null`|
|`canvasClassName`|custom className to be applied to the canvas element|`null`|

## Contributing
* Make changes to Knob.js, then run `npm run babel` to transpile.

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