# rb-buttons

> react-basics button component

Latest version **1.0.1** (published 2018-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install rb-buttons
pnpm add rb-buttons
yarn add rb-buttons
bun add rb-buttons
```

## 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.1 |
| Published | 2018-03-30 |
| First published | 2018-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 330 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eduardo Grajales Villanueva @EdGraVill |
| Maintainers | edgravill |
| Keywords | react, basics, react-basics, button |

## Links

- npm: https://www.npmjs.com/package/rb-buttons
- Repository: https://github.com/EdGraVill/rb-button
- Homepage: https://github.com/EdGraVill/rb-button#readme
- Issues: https://github.com/EdGraVill/rb-button/issues
- npm.io page: https://npm.io/package/rb-buttons

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^16.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.1 (latest) — 2018-03-30
- 1.0.0 — 2018-03-30
- 0.1.0 — 2018-03-27

## README

# Buttons - React Basics

A React Basics Buttons component. Stateless, fully optimized with css animations, highly customizable and Mobile support.

## Installation

Into your project's root directory run the following command:


**npm**
```console
npm i -P rb-buttons
```

**Yarn**
```console
yarn add rb-buttons
```

This package only has 1 dependencies:

- `react@16.2.0`

## Example

Buttons is one of the components inside React Basics, so if you want test it, go https://edgravill.github.io/react-basics and see it working.

> The website is under construction

## Usage

Component constantly changes its width, so it's recommendable put inside div container to control its position.

```javascript
import React from 'react';
import Button from 'rb-buttons';

const Index = ({
  fetching,
  sendComment,
}) => (
  <div>
    <textarea id="comment" />
    <div className="buttonContainer">
      <Button
        active={!fetching}
        loading={fetching}
        onClick={() => sendComment(document.getElementById('comment'))}
        text="Enviar"
      />
    </div>
  </div>
);
```

## API

|Prop|Required|Type|Default|Description|
|----|--------|----|-------|-----------|
|active|`false`|`boolean`|`true`|Prop who determines if button catch click action.|
|loaded|`false`|`boolean`|`false`|Prop who determines if loading finish.|
|loadedStyle|`false`|`Object`|`{}`|Button style when "loaded" prop is `true`.|
|loadedText|`false`|`string`|`''`|Text to display in button when "loaded" prop is `true`. Only works in `'filler'` or `'text'` loading type.|
|loading|`false`|`boolean or number`|`false`|Prop who determines if loading animation start. If loading type is `'filler'` this prop also take a number between 0 an 1 to handle loading %.|
|loadingStyle|`false`|`Object`|`{}`|Button style when "loading" prop is `true`.|
|loadingText|`false`|`string`|`''`|Text to display in button when "loading" prop is `true`. Only works in `'filler'` or `'text'` loading type.|
|loadingType|`false`|`Enum: 'spinner', 'textSpinner', 'filler', 'text'`|`'spinner'`|Type of loading animation. See [Loading Types description below](#loadingTypes).|
|onClick|`true`|`Function`|`undefined`|Function to perform when user click the button.|
|style|`false`|`Object`|`{}`|Style of the button when is normal.|
|text|`true`|`string`|`undefined`|Default text to display in the button. If "loadedText" or "loadingText" props are undefined or empty this text will be displayed.|

### loadingTypes

#### spinner

The buttom becomes in a spinner circle

#### textSpinner

The buttom keep its shape, but the text becomes in a spinner circle

#### filler

Alfa white layer fill the buttom

#### text

There is no animation, only changes the display text if is loading and when is loaded

## Goals

- [ ] Integration with icons (Under develop).
- [ ] Slide icon for confirm or perform any action.

> looking for more? - Do a pull request with your proposals ;)

## Collaborators

- Eduardo Grajales Villanueva @EdGraVill

> If you want to collaborate with this or another exist or new component inside React Basics, first do a pull request and then email me: edgravill@gmail.com

If you want pull request some changes, don't forget build it firt with the following command:

**npm**
```console
npm run build
```

**Yarn**
```console
yarn build
```

Once you're a collaborator don't forget 3 rules:

1. Version are `Mayor` (If APIs are deleted or create new one) `.` `Medium` (If APIs changes without changing name) `.` `Minimum` (If do some hotfix, change Documentation or develop configurations). This is because all 1.x.x are compatible, but are incompatible with 2.x.x
2. Build a great components and do the best documentation as you can.
3. Share with your developer friends. It would be useful for them.

Don't forget [join discussion on Slack](https://join.slack.com/t/react-basics/shared_invite/enQtMzM4MDMyNzM5NjgxLTMxYzcwMDMwYmNkZGIxNWFkZGZhMDVmNWU3OTQ3ZDhlYmZhOWU0NTkwMTdkNzg5ZTJhNWE3MDJlNTc3OGU4YjA)

## License

MIT License

Copyright (c) 2018 Eduardo Grajales Villanueva

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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