1.0.5 • Published 3 years ago

react-pill-switcher v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-pill-switcher

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

NPM JavaScript Style Guide

Install

npm install --save react-pill-switcher

Simple Usage

import PillSwitcher from 'react-pill-switcher'

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

Demo

Coming soon...

Component Props

PropTypeDescription
name*strThe name for the input element
options*[str] or [{label: str, icon: obj, value: any}]A list of options
onChangeeventcallback event that returns the input value
activeBgcolorColor code for the background of the pill
labelColorcolorColor code for the background of the active label
activeColorcolorColor code for the active label
classNamestrClasses for the Switcher container
labelClassNamestrClasses for the Switcher labels
labelActiveClassNamestrClasses for the Switcher labels when active
pillClassNamestrClasses for the Switcher Pill
onanyWhen changed, the compoent is rerendered (used to prevent visual bugs)
isFullbooleanIf true, the component will fill the containers width

License

MIT © lalodoble