KendoReact Inputs Overview

The KendoReact Inputs are fields which allow for an input of data, based on a specific and predefined format.

The Inputs components are part of the KendoReact library which provides native Kendo UI components for the React ecosystem and are available under the kendo-react-inputs NPM package.

Basic Usage

The following example demonstrates all of the components included in Inputs package in action.

class App extends React.Component {
    render() {
        return (
             <div className="row example-wrapper" style={{ minHeight: 450 }}>
                 <div className="col-12 col-md-6 example-col">
                    <p>ColorPicker</p>
                    <ColorPicker />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>Input</p>
                    <Input label="First name"/>
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>MaskedTextBox</p>
                    <MaskedTextBox
                        mask="9-000"
                        defaultValue="_-___"
                    />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>NumericTextBox</p>
                    <NumericTextBox
                        defaultValue={123.45}
                        format="c2"
                    />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>Slider</p>
                    <Slider min={1} max={10} step={1} defaultValue={4} />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>Switch</p>
                    <Switch />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>ColorGradient</p>
                    <ColorGradient />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>ColorPalette</p>
                    <ColorPalette palette='office' tileSize={30} />
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>Checkbox</p>
                    <Checkbox />
                </div>
            </div>
        );
    }
}
ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);

Installation

  1. Download and install the package:

    npm install --save @progress/kendo-react-inputs @progress/kendo-react-intl @progress/kendo-drawing
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { NumericTextBox, MaskedTextBox, Input, Switch, Slider, ColorGradient, ColorPalette, ColorPicker, Checkbox } from '@progress/kendo-react-inputs';
    // CommonJS format
    const { NumericTextBox, MaskedTextBox, Input, Switch, Slider, ColorGradient, ColorPalette, ColorPicker, Checkbox } = require('@progress/kendo-react-inputs');
  3. 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 Inputs package requires the following peer dependencies that have to be installed by your application:

  • react 16.8.2*
  • react-dom
  • @progress/kendo-react-intl
  • @progress/kendo-drawing
 /