0.1.5 • Published 2 years ago
@tmnrp/react-progressbar-line v0.1.5
@tmnrp/react-progressbar-line
@tmnrp/react-progressbar-line is a lightweight latest treanding markup to display the progressbar as a line at the top of the page.
eg: Youtube loading
Features
- Render progressbar with configurable background color, height and frequency
- Inbuilt activate and kill implementation. (no more self state handling)
Examples link
https://tmnrp.github.io/react-lib/
Installation link
$ npm i @tmnrp/react-progressbar-line
Properties
@tmnrp/react-progressbar-line is currently extended with the following properties.
Properties | type | Description |
---|---|---|
bgColor | string | Background color of the progressbar line |
height | integer | Height of the progressbar line |
frequency | integer | Interval in which progressbar should step ahead |
Inbuilt methods
@tmnrp/react-progressbar-line is currently extended with the following ref methods.
Methods | Description |
---|---|
activate | Starts movement of progress bar |
kill | Kill and the progressbar away by directly completing the remaining distance |
Implementation
import {ReactProgressbarLine} from "@tmnrp/react-progressbar-line";
export const App = () => {
const lpref = useRef();
//
return (<>
<ReactProgressbarLine ref={lpref} />
<div>
<div>
<div>React Progressbar Line</div>
<div>
<div
onClick={() => {
lpref?.current?.activate();
}}
>
Start
</div>
<div
onClick={() => {
lpref?.current?.kill();
}}
>
Stop
</div>
</div>
</div>
</div>
</>);
};
Todos
- Let me know :-)
License
MIT Tony Martin