KendoReact Inputs Overview

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

The KendoReact Inputs components are distributed through NPM under the kendo-react-inputs NPM package.

The Inputs package is part of KendoReact, a professionally built commercial UI library. To try out this package you need to sign up for a 30-day trial, which gives you access to the full KendoReact library.

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>RangeSlider</p>
                    <RangeSlider min={1} max={100} step={1} defaultValue={{start: 30, end: 70}} />
                </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 label="Checkbox Option 1" defaultChecked={true}/>
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>RadioButton</p>
                    <RadioButton label="Radio Option 1" name="group1" value="option 1" defaultChecked={true}/>
                </div>
                <div className="col-12 col-md-6 example-col">
                    <p>RadioGroup</p>
                    <RadioGroup data={[
                        { label: 'Option 1', value: 'one' },
                        { label: 'Option 2', value: 'two' },
                        { label: 'Option 3', value: 'three' },
                    ]} />
                </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, RangeSlider ColorGradient, ColorPalette, ColorPicker, Checkbox } from '@progress/kendo-react-inputs';
    // CommonJS format
    const { NumericTextBox, MaskedTextBox, Input, Switch, Slider, RangeSlider, 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