# react-native-user-score

> A lightweight, flexible user score component

Latest version **1.0.5** (published 2018-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-user-score
pnpm add react-native-user-score
yarn add react-native-user-score
bun add react-native-user-score
```

## 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.0.5 |
| Published | 2018-02-09 |
| First published | 2018-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Artiom Shapovalov |
| Maintainers | artiom |
| Keywords | react, native, score, star, rating, user, points |

## Links

- npm: https://www.npmjs.com/package/react-native-user-score
- Repository: https://github.com/ArtiomShapovalov/react-native-user-score
- npm.io page: https://npm.io/package/react-native-user-score

## Dependencies (2)

- [flow-bin](https://npm.io/package/flow-bin.md) ^0.63.1
- [flow-typed](https://npm.io/package/flow-typed.md) ^2.2.3

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

- 1.0.5 (latest) — 2018-02-09
- 1.0.4 — 2018-02-09
- 1.0.3 — 2018-02-09
- 1.0.2 — 2018-02-09
- 1.0.1 — 2018-02-09
- 1.0.0 — 2018-02-09

## README

# react-native-user-score

A flexible, lightweight user score component. The component responds to drags and not just clicks, icon boundaries are computed automatically.

<img src="https://i.imgur.com/YtC6xgS.gif" />

## Installation

```sh
npm i -S react-native-user-score
```

or

```sh
yarn add react-native-user-score
```

## Usage

```js
import React, { Component } from 'react';

import { View, ScrollView, Text } from 'react-native';

import ScoreView from 'react-native-score-rating';

export class Demo extends Component<*,*> {
  state = {
    value: 2,
    scrollEnabled: true,
  };

  render() {
    return (
      <View
        style={{
          flex: 1,
          justifyContent: 'center',
        }}
      >
        <ScrollView scrollEnabled={this.state.scrollEnabled}>
          <ScoreView
            value={this.state.value}
            maximum={5}
            onChangeValue={value =>
              this.setState({ scrollEnabled: false, value })
            }
            onChangeFinish={() => this.setState({ scrollEnabled: true })}
            renderItem={active => (
              <Text color={active ? Colors.yellow20 : Colors.dark20} icon>
                {Icons.star}
              </Text>
            )}
          />
        </ScrollView>
      </View>
    );
  }
}
```

Note: Text is a custom component to demonstrate coloring. You have absolute control in the icon rendered -- styling included.

## Props

| Name           |                            Description                             |                                Default |
| :------------- | :----------------------------------------------------------------: | -------------------------------------: |
| value         |                           Current score                            |                                      0 |
| maximum        |                    Maximum score                     |                                      5 |
| spacing        |                  Spacing between each component\*                  |                                     10 |
| onChangeValue  |      Func:bool=>JSX to render a single score component      | Not supplied - requires implementation |
| onChangeFinish | Func:() => void for triggering event after score is finaly changed | Not supplied - requires implementation |

\* Spacing is applied as a right margin of all inner scores.

## License

The MIT License.

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