DropDowns Overview
The DropDowns allow you to choose from a predefined list of options.
A list of suggestions for typed content.
A list for picking single items or entering custom values.
A predefined list of options for picking single values.
A predefined list of options for multiple item selection.
Basic Usage
The following example demonstrates the AutoComplete, ComboBox, DropDownList, and MultiSelect components in action.
import React from 'react';
import ReactDOM from 'react-dom';
import { AutoComplete, ComboBox, DropDownList, MultiSelect } from '@progress/kendo-react-dropdowns';
class AppComponent extends React.Component {
sports = [ "Baseball", "Basketball", "Cricket", "Field Hockey", "Football", "Table Tennis", "Tennis", "Volleyball" ];
render() {
return (
<div className="example-wrapper" style={{ minHeight: '400px' }}>
<div className="col-xs-12 col-sm-7 example-col">
<p>AutoComplete</p>
<AutoComplete data={this.sports} placeholder="Your favorite sport" />
</div>
<div className="col-xs-12 col-sm-7 example-col">
<p>ComboBox</p>
<ComboBox data={this.sports} defaultValue="Basketball" />
</div>
<div className="col-xs-12 col-sm-7 example-col">
<p>DropDownList</p>
<DropDownList data={this.sports} defaultValue="Basketball" />
</div>
<div className="col-xs-12 col-sm-7 example-col">
<p>MultiSelect</p>
<MultiSelect data={this.sports} defaultValue={[ "Basketball", "Cricket" ]} />
</div>
</div>
);
}
}
ReactDOM.render(
<AppComponent />,
document.querySelector('my-app')
);
Installation
-
Download and install the package. Use Node.js v5.0.0 or later.
npm install --save @progress/kendo-react-dropdowns @progress/kendo-react-intl
-
Once installed, import the package module.
// ES2015 module syntax import { AutoComplete, ComboBox, DropDownList, MultiSelect } from '@progress/kendo-react-dropdowns';
// CommonJS format const { AutoComplete, ComboBox, DropDownList, MultiSelect } = require('@progress/kendo-react-dropdowns');
You are required to install one of the Kendo UI themes to style your components. For more information on how to add the styles, refer to the article on getting started.
Dependencies
The DropDowns package requires you to install the following peer dependencies in your application:
- react 16.0.0*
- react-dom
- @progress/kendo-react-intl