KendoReact Buttons Overview

The KendoReact Buttons provide a clickable UI functionality with arbitrary content.

The Buttons components are 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.

Basic Usage

The following example demonstrates the Buttons components in action.

<style>
  .k-button + .k-button {
      margin-left: 5px
  }
</style>
class App extends React.Component {
    render() {
        return(
            <div class="example-wrapper">
                <div class="example-col">
                  <p>Button</p>
                  <Button>Default</Button>
                  <Button primary={true}>Primary</Button>
                  <Button disabled={true}>Disabled</Button>
                </div>
                <div class="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 class="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 class="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 class="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>
                </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, Toolbar, ToolbarItem } from '@progress/kendo-react-buttons';
    // CommonJS format
    const { Button, ButtonGroup, DropDownButton, DropDownButtonItem,
      SplitButton, SplitButtonItem, 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
 /