# react-sort-component

> [![Travis](https://img.shields.io/travis/nithinpeter/react-sort.svg)]()

Latest version **1.3.0** (published 2016-12-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-sort-component
pnpm add react-sort-component
yarn add react-sort-component
bun add react-sort-component
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2016-12-11 |
| First published | 2016-12-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nithinpeter |

## Links

- npm: https://www.npmjs.com/package/react-sort-component
- npm.io page: https://npm.io/package/react-sort-component

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^15.4.1

## Recent versions

- 1.3.0 (latest) — 2016-12-11
- 1.2.1 — 2016-12-11
- 1.2.0 — 2016-12-11
- 1.1.3 — 2016-12-11
- 1.1.2 — 2016-12-11
- 1.1.1 — 2016-12-11
- 1.1.0 — 2016-12-11
- 1.0.0 — 2016-12-10

## README

[![Travis](https://img.shields.io/travis/nithinpeter/react-sort.svg)]()

# React Sort

This ReactSort compoent will help you render react components in a sorted manner.

### Installation

```
npm install --save react-sort-component

or

yarn add react-sort-component (If you are using Yarn)
```

### Usage

```
import ReactSort from 'react-sort';

<ReactSort 
    dataSource={[{ name: "messi", age: 25}, { name: "nithin", age: 12 }]}
    sortOptions={{ sortField: "age", sortDir: "des" }} >     
        { (props) => <div>{props.name} - {props.age}</div> }
</ReactSort>
```

ReactSort component gives you full control over how you build your UI. It is just a pure functional component to which you have to pass few props for it to work. 

### Props

| Name         |   required    |  description |
|--------------|:-------------:|:------------------------|
| dataSource   |  true         | Array of objects        |
| sortOptions  |  true         | ```{ sortField: string, sortDir: 'asc'|'des', isCaseSensitive: boolean(optional, defaut = false) }```|
| renderHeader |  false        | Function which receives three arguements and returns the custom header you specify. ```(utils, sortOptions, dataSource) => <Header />```|

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