Selectbox
An advanced animating component that displays a styled select based list.
Demo
API
Component takes all select related props given along with custom props below:
| Props | Type | Required | Default | Description |
|---|---|---|---|---|
| callback | Func | false | null | Returns target selected |
| form | Boolean | false | false | If true, adds a hidden input to store value |
| label | String | false | null | Displays text label above Component |
| value | String | false | null | Assigns pre-selected value to Component |
Example:
import { Selectbox, Button } from 'react-horcrux';
export default YourForm function() {
return(
<form onSubmit={doSomething}>
<Selectbox callback={doSomething} value={stateVal}>
<p value="gryffindor">gryffindor</p>
<p value="ravenclaw">ravenclaw</p>
<p value="hufflepuff">hufflepuff</p>
<p value="slytherin">slytherin</p>
</Selectbox>
<Button type="submit">do it</Button>
</form>
);
}