# react-pill-switcher

> A simple yet beautifull switcher to transition between two or more options. Made for React.

Latest version **1.0.5** (published 2021-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-pill-switcher
pnpm add react-pill-switcher
yarn add react-pill-switcher
bun add react-pill-switcher
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-09-15 |
| First published | 2021-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 33.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | lalodoble |
| Maintainers | lalodoble |
| Keywords | react, reactjs, switcher, select, options, animated, tabs, component |

## Links

- npm: https://www.npmjs.com/package/react-pill-switcher
- Repository: https://github.com/lalodoble/react-pill-switcher
- Issues: https://github.com/lalodoble/react-pill-switcher/issues
- npm.io page: https://npm.io/package/react-pill-switcher

## Dependencies (2)

- [sass](https://npm.io/package/sass.md) ^1.35.0
- [classnames](https://npm.io/package/classnames.md) ^2.3.1

## 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) — 2021-09-15
- 1.0.4 — 2021-08-02
- 1.0.3 — 2021-06-19
- 1.0.2 — 2021-06-18
- 1.0.1 — 2021-06-16
- 1.0.0 — 2021-06-15

## README

# react-pill-switcher

> A simple yet beautifull switcher to transition between two or more options. Made for React.

[![NPM](https://img.shields.io/npm/v/react-pill-switcher.svg)](https://www.npmjs.com/package/react-pill-switcher) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-pill-switcher
```

## Simple Usage

```js
import PillSwitcher from 'react-pill-switcher'

export function App() {
  return <PillSwitcher options={['One', 'Two', 'Three']} />
}
```

## Demo

Coming soon...
<!-- []() -->

## Component Props
|Prop               |Type                                                |Description                                       |
|-------------------|----------------------------------------------------|--------------------------------------------------|
|name*              |`str`                                               |The name for the input element                    |
|options*           |`[str]` or `[{label: str, icon: obj, value: any}]`  |A list of options                                 |
|onChange           |`event`                                             |callback event that returns the input value       |
|activeBg           |`color`                                             |Color code for the background of the pill         |
|labelColor         |`color`                                             |Color code for the background of the active label |
|activeColor        |`color`                                             |Color code for the active label                   |
|className          |`str`                                               |Classes for the Switcher container                |
|labelClassName     |`str`                                               |Classes for the Switcher labels                   |
|labelActiveClassName          |`str`                                    |Classes for the Switcher labels when active       |
|pillClassName     |`str`                                                |Classes for the Switcher Pill                     |
|on                 |`any`                                               |When changed, the compoent is rerendered (used to prevent visual bugs)        |
|isFull             |`boolean`                                           |If true, the component will fill the containers width|

## License

MIT © [lalodoble](https://github.com/lalodoble)

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