KendoReact Buttons Overview

The KendoReact Buttons package deliver components that represent the trigger for a simple action that user can take.

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

The Buttons 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 the Button, ButtonGroup, DropDownButton, SplitButton, Toolbar, Chip, and ChipList components in action.

<style>
  .k-button + .k-button {
      margin-left: 5px
  }
</style>
class App extends React.Component {
    render() {
        return(
            <div className="example-wrapper">
                <div className="example-col">
                  <p>Button</p>
                  <Button>Default</Button>
                  <Button primary={true}>Primary</Button>
                  <Button disabled={true}>Disabled</Button>
                </div>
                <div className="example-col">
                  <p>ButtonGroup</p>
                  <ButtonGroup>
                    <Button togglable={true}>
                      Option A
                    </Button>
                    <Button togglable={true}>
                      Option B
                    </Button>
                    <Button togglable={true}>
                      Option C
                    </Button>
                  </ButtonGroup>
                </div>
                <div className="example-col">
                  <p>DropDownButton</p>
                  <DropDownButton text="User Settings" icon="cog">
                    <DropDownButtonItem text="My Profile" />
                    <DropDownButtonItem text="Friend Requests" />
                    <DropDownButtonItem text="Account Settings" />
                    <DropDownButtonItem text="Support" />
                    <DropDownButtonItem text="Log Out" />
                  </DropDownButton>
                </div>
                <div className="example-col">
                  <p>SplitButton</p>
                  <SplitButton text="Paste" icon="paste">
                    <SplitButtonItem text="Keep Text Only" icon="paste-plain-text" />
                    <SplitButtonItem text="Paste as HTML" icon="paste-as-html" />
                    <SplitButtonItem text="Paste Markdown" icon="paste-markdown" />
                    <SplitButtonItem text="Set Default Paste" />
                  </SplitButton>
                </div>
                <div className="example-col">
                  <p>Toolbar</p>
                  <Toolbar>
                    <ToolbarItem>
                      <ButtonGroup>
                          <Button icon="bold" title="Bold" togglable={true} />
                          <Button icon="italic" title="Italic" togglable={true} />
                          <Button icon="underline" title="Underline" togglable={true} />
                      </ButtonGroup>
                    </ToolbarItem>
                    <ToolbarSeparator />
                    <ToolbarItem>
                      <ButtonGroup>
                          <Button icon="align-left" title="Align Left" togglable={true} />
                          <Button icon="align-center" title="Align Center" togglable={true} />
                          <Button icon="align-right" title="Align Right" togglable={true} />
                          <Button icon="align-justify" title="Align Justify" togglable={true} />
                      </ButtonGroup>
                    </ToolbarItem>
                    <ToolbarSeparator />
                    <ToolbarItem>
                        <Button icon="cut" title="Cut">Cut</Button>
                    </ToolbarItem>
                    <ToolbarSeparator />
                    <ToolbarItem>
                        <Button icon="copy" title="Copy">Copy</Button>
                    </ToolbarItem>
                    <ToolbarSeparator />
                    <ToolbarItem>
                        <Button icon="paste" title="Paste">Paste</Button>
                    </ToolbarItem>
                  </Toolbar>
                  <p>Chip and ChipList</p>
                    <ChipList
                        dir="rtl"
                        selection="single"
                        data={[
                            { text: 'Berry', value: 'berry' },
                            { text: 'Apple', value: 'apple' },
                            { text: 'Kiwi', value: 'kiwi'   },
                            { text: 'Banana', value: 'banana' }
                        ]}
                    />
                </div>
            </div>
        )
    }
}

ReactDOM.render(
    <App/>,
    document.querySelector('my-app')
)

Installation

  1. Download and install the package. Use Node.js v5.0.0 or later.

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

    // ES2015 module syntax
    import { Button, ButtonGroup, DropDownButton, DropDownButtonItem,
      SplitButton, SplitButtonItem, Chip, ChipList, Toolbar, ToolbarItem } from '@progress/kendo-react-buttons';
    // CommonJS format
    const { Button, ButtonGroup, DropDownButton, DropDownButtonItem,
      SplitButton, SplitButtonItem, Chip, ChipList, Toolbar, ToolbarItem } = require('@progress/kendo-react-buttons');
  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 Buttons package requires you to install the following peer dependencies in your application:

  • react 16.8.2*
  • react-dom