# RockSelect

> Fancy and simple Select option component in react.js

Latest version **0.0.1** (published 2016-04-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install RockSelect
pnpm add RockSelect
yarn add RockSelect
bun add RockSelect
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-04-10 |
| First published | 2016-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gerardo Gallegos |
| Maintainers | gerardogallegos |

## Links

- npm: https://www.npmjs.com/package/RockSelect
- npm.io page: https://npm.io/package/RockSelect

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^0.14.8
- [react-dom](https://npm.io/package/react-dom.md) ^0.14.8

## Recent versions

- 0.0.1 (latest) — 2016-04-10

## README

# RockSelect
Fancy and simple Select option component in react.js

![alt tag](https://cloud.githubusercontent.com/assets/9009074/14406640/ebc09c40-fe72-11e5-8779-6367af2a5d68.png)

## Usage
### Basic use

You can pass a simple list of string and specify the function that will trigger in every click on the options

```javascript
// Import dependencies 
import React from 'react'
import { render } from 'react-dom';

// Import RockSelect
import RockSelect from './components/RockSelect'

let foo = ()=>{
  alert('FOO')
}

render(
  <div>
    <RockSelect options={['One', 'Two', 'three']} generalClick={foo} iconClass="icon-code" />
  </div>, document.getElementById('app')
)
```

### Object List items

Or you can pass a list of Objects with the configuration
```
const OPTIONS = [
  {
    value : 'Option 1',
    click : theAction
  }
]

```

### Full Example

```javascript
// Import dependencies 
import React from 'react'
import { render } from 'react-dom';

// Import RockSelect
import RockSelect from './components/RockSelect'

let foo = ()=>{
  alert('FOO')
}

let bar = ()=>{
  alert('BAR')
}

let baz = ()=>{
  alert('BAZ')
}

const OPTIONS = [
     { 
        value : 'Option 1',
        click : foo
     },
     { 
        value : 'Option 2',
        click : bar
     },
     { 
        value : 'Option3',
        click : baz
     }
]

render(
  <div>
    <RockSelect options={OPTIONS} iconClass="icon-code" />
  </div>, document.getElementById('app')
)
```


## API
### Select props

name | description | type | default 
------------ | ---- | ------------- | --------------
options | List of options items | Array | [ ] 
defaultValue | Default Select option | String | first Option in the list 
generalClick | This method is triggered, each onClick in any options | Function(value) | -
iconClass | Class applied to icon via font icon or background image | String| ' '

## Development

```
npm install
npm start
```
http://localhost:8080/webpack-dev-server/

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