Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itsjonq/progress-kit

⏳ A Progress Component Toolkit for React
https://github.com/itsjonq/progress-kit

accessibility component progress progress-bar react toolkit

Last synced: 2 months ago
JSON representation

⏳ A Progress Component Toolkit for React

Awesome Lists containing this project

README

        

# ⏳ ProgressKit

[![Build Status](https://travis-ci.org/ItsJonQ/progress-kit.svg?branch=master)](https://travis-ci.org/ItsJonQ/progress-kit)

> A Progress Component Toolkit for React

## Table of contents

- [Installation](#installation)
- [Usage](#usage)
- [Ready-made Progress Indicators](#ready-made-progress-indicators)
- [Creating your own](#creating-your-own)

## Installation

```
npm install progress-kit
```

## Usage

### Ready-made Progress Indicators

```jsx
import React from "react";
import { ProgressBar } from "progress-kit";

function Example() {
return ;
}
```

### Creating your own

The `useProgressState` hook is inspired by the patterns from [Reakit](https://reakit.io/).

```jsx
import React from "react";
import { View } from "styled-view";
import { progressDefaultProps, useProgressState } from "progress-kit";

export const defaultProps = {
...progressDefaultProps,
color: "currentColor",
height: 20,
transition: "all 200ms ease"
};

export function MyProgressBar(props) {
const { color, transition, height, ...restProps } = props;

const { progress, progressProps } = useProgressState(props);

const barCssProps = {
backgroundColor: color,
height,
transition
};

return (

);
}

MyProgressBar.defaultProps = defaultProps;

export default ProgressBar;
```