rel

relect

A Tiny React Single Select Component.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

35

Maintenance

Last Commit

4mos ago

Contributors

5

Package

Dependencies

1

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Relect

A Tiny React Single Select Component.
Example

Install

npm i relect -S

Usage

import React  from 'react';
import Relect from 'relect';

// include styles
import 'relect/lib/relect.css';

const options = [
    { text: 'one', value: 1 },
    { text: 'two', value: 2 }
];

class App extends React.Component {

    constructor(props) {
        super(props);
        this.state = { chosen : null }
    }
    
    onChange(index) {
        this.setState({ chosen : index });
    }

    render() {
        return (
            <Relect options={options}
                    chosen={this.state.chosen}
                    onChange={this.onChange.bind(this)}
            />
        )
    }
}

Props

PropertyTypeDefaultDescription
widthnumber240width of select
heightnumber36height of select
optionsarray/options
chosennumber/index of chosen option
tabIndexnumber-1tab order
disabledboolfalsewhether to disable select
autoBlurboolfalseauto blur after selection
placeholderstring/placeholder text
optionHeightnumber30height of option

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial