All Components

Inputs Overview

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

Basic Usage

The following example demonstrates the NumericTextBox and Input components in action.

class App extends React.Component {
    value = 123.45;
    render() {
        return (
             <div className="row example-wrapper" styles={{ minHeight: 450 }}>
                <div className="col-xs-12 col-md-6 example-col">
                    <p>NumericTextBox</p>
                    <NumericTextBox
                        defaultValue={this.value}
                        format="c2"
                    />
                </div>
                <div className="col-xs-12 col-md-6 example-col">
                    <p>Switch</p>
                    <Switch />
                </div>
                <div className="col-xs-12 col-md-12 example-col">
                    <p>Input</p>
                    <Input label="First name"/>
                </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
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { NumericTextBox, Input, Switch } from '@progress/kendo-react-inputs';
    // CommonJS format
    const { NumericTextBox, Input, Switch } = require('@progress/kendo-react-inputs');
  3. You are required to install one of the Kendo UI themes for React 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
  • react-dom
  • @progress/kendo-react-intl
In this article