4.0.2 • Published 5 years ago

@opuscapita/react-floating-select v4.0.2

Weekly downloads
211
License
MIT
Repository
github
Last release
5 years ago

react-floating-select

Description

Originally this component was introduced in order to enhance react-select by fixing bug#810. When react-select was upgraded to version 2.0.0, the original need for this component disappeared. Since react-select v2.0.0 this component is needed for specifying OC specific styles for the floating select component.

Installation

npm install @opuscapita/react-floating-select

Demo

View the Demo

Change log

View the Change log

Migrate guide

View the Migrate guide between major versions

Builds

UMD

The default build with compiled styles in the .js file. Also minified version available in the lib/umd directory.

CommonJS/ES Module

You need to configure your module loader to use cjs or es fields of the package.json to use these module types. Also you need to configure sass loader, since all the styles are in sass format.

Exported components

  • FloatingSelect
  • FloatingSelectCreatable
  • FloatingSelectInfinite
  • FloatingSelectPortal will be removed
  • FloatingSelectPortalCreatable will be removed

API

Prop nameTypeDefaultDescription
namestringIt's recommended to give unique name for select component
controlHeightstringCustom height of the control
customStylesobject{}Custom style functions to be merged with default style functions

Code example

import React from 'react';
import { FloatingSelect } from '@opuscapita/react-floating-select';
import myOptions from './my-options';

export default class ReactView extends React.Component {
  state = {
    value: null,
  }

  handleOnChange = value => this.setState({ value })

  render() {
    return (
      <FloatingSelect
        name="my-select"
        options={myOptions}
        value={this.state.value}
        onChange={this.handleOnChange}
      />
    );
  }
}
4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.7.0

5 years ago

3.6.4

5 years ago

3.6.3

5 years ago

3.6.2

5 years ago

3.6.1

5 years ago

3.6.0

5 years ago

3.5.2

5 years ago

3.5.1

5 years ago

3.5.0

5 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.2

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.4

5 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.2

5 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.3

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

7 years ago