# react-timeline-bar

> timeline control to use for videos

Latest version **1.0.7** (published 2021-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-timeline-bar
pnpm add react-timeline-bar
yarn add react-timeline-bar
bun add react-timeline-bar
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-02-12 |
| First published | 2021-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 30.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | okloecker |
| Maintainers | okl |

## Links

- npm: https://www.npmjs.com/package/react-timeline-bar
- Repository: https://github.com/okloecker/react-timeline-bar
- npm.io page: https://npm.io/package/react-timeline-bar

## Recent versions

- 1.0.7 (latest) — 2021-02-12
- 1.0.5 — 2021-02-12
- 1.0.4 — 2021-02-12
- 1.0.3 — 2021-02-12
- 1.0.2 — 2021-02-12
- 1.0.1 — 2021-02-12
- 1.0.0 — 2021-02-12

## README

# react-timeline-bar

> timeline control to use for videos

[![NPM](https://img.shields.io/npm/v/react-timeline-bar.svg)](https://www.npmjs.com/package/react-timeline-bar) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-timeline-bar
```

## Usage

```jsx
import React from 'react'

import Timeline from 'react-timeline-bar'
import 'react-timeline-bar/dist/index.css'

const Example = () => {
  render() {
    return <Timeline onSetNewTime={seconds => console.log(seconds)} />
  }
}
```

## Props

* totalDuration total length of e.g. a video, in seconds
* currentTime seconds where the video's play time would currently be
* onSetNewTime callback returning the seconds value in the totalDuration space that a user clicked
* height div height of component, default 50px
* width div width of component, default 300px
* padding left/right padding, default 10px
* color default black
* text optional text to be displayed after total duration

## Behaviour
* the display is similar to the timeline in HTML5 <video> controls
* mouse movement is translated into time value within the totalDuration time space
* clicking will return the time value where the mouse is back to the parent component through the onSetNewTime callback
* when using 'width="100%"', set "padding={0}" to avoid miscalculations of mouse position clicks

## Others
* bootstrapped with [create-react-library](https://github.com/transitive-bullshit/create-react-library)

## License

MIT © [npm okl](https://github.com/okloecker)

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