# rights-selector

> A Simple component to select rights

Latest version **1.0.4** (published 2018-06-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install rights-selector
pnpm add rights-selector
yarn add rights-selector
bun add rights-selector
```

## 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.4 |
| Published | 2018-06-12 |
| First published | 2018-06-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Victor Trejo |
| Maintainers | xvicmanx |
| Keywords | rights, selector, react |

## Links

- npm: https://www.npmjs.com/package/rights-selector
- Repository: https://github.com/xvicmanx/rights-selector
- Homepage: https://github.com/xvicmanx/rights-selector#readme
- Issues: https://github.com/xvicmanx/rights-selector/issues
- npm.io page: https://npm.io/package/rights-selector

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.2.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [bem-react-component-creator](https://npm.io/package/bem-react-component-creator.md) ^1.2.0

## 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.4 (latest) — 2018-06-12
- 1.0.3 — 2018-06-12
- 1.0.2 — 2018-06-12
- 1.0.1 — 2018-06-12
- 1.0.0 — 2018-06-12

## README

# Rights Selector
A Simple component to select rights.


## Example

```shell 
$ npm install rights-selector --save
```

```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import RightsSelector from 'rights-selector'; 

const App = () => (
  <RightsSelector
    actionsLabel="Actions"
    resourcesLabel="Resources"
    actions={[
      {
        value: 'create',
        label: 'Create',
      },
      {
        value: 'read',
        label: 'Read',
      },
      {
        value: 'update',
        label: 'Update',
      },
      {
        value: 'delete',
        label: 'Delete',
      },
    ]}
    resources={[
      {
        value: 'book',
        label: 'Book',
      },
      {
        value: 'author',
        label: 'Author',
      }
    ]}
    onChange={(values) => {
      console.log(values);
    }}
  />
);


ReactDOM.render(
  <App />,
  document.getElementById('root')
);

```

## Component Properties

#### `actionsLabel`: string
the label for the actions section

#### `resourcesLabel`: string
the label for the resources section

#### `onChange`: function
Listener to change event.

#### `resources`: array
List of resources.

#### `actions`: array
List of actions.

#### `rights`: object
Rights values

#### `className`: string
Component's class

#### `style`: object
Component's style



## Comments
Feel free to make any suggestion to improve this component.

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