Ripple Overview

The Ripple component provides the Material ink ripple effect for the KendoReact components and is fully compatible with all available Kendo UI themes.

The effect gets applied to all components that are located inside the Ripple component.

Basic Usage

The following example demonstrates how to use the Ripple component and add the ripple effect to buttons, checkboxes and radiobuttons.

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Ripple } from '@progress/kendo-react-ripple';

class App extends React.Component {
    render() {
        return (
            <div className="example-wrapper">
                <Ripple>
                    <div className="row">
                        <div className="col-xs-12 col-sm-4 example-col">
                            <p>Ripple on Buttons</p>
                            <button className="k-button mt-3 mb-1">Default Button</button><br />
                            <button className="k-button k-primary mt-1 mb-1">Primary Button</button><br />
                            <button className="k-button k-bare mt-1 mb-1">Bare Button</button>
                        </div>
                        <div className="col-xs-12 col-sm-4 example-col">
                            <p>Ripple on Checkboxes</p>
                            <p style={{ lineHeight: '2.5em' }}>
                                <input type="checkbox" id="c1" className="k-checkbox" />
                                <label className="k-checkbox-label" htmlFor="c1">Checkbox 1</label><br />
                                <input type="checkbox" id="c2" className="k-checkbox" />
                                <label className="k-checkbox-label" htmlFor="c2">Checkbox 2</label><br />
                                <input type="checkbox" id="c3" className="k-checkbox" />
                                <label className="k-checkbox-label" htmlFor="c3">Checkbox 3</label>
                            </p>
                        </div>
                        <div className="col-xs-12 col-sm-4 example-col">
                            <p>Ripple on Radio Buttons</p>
                            <p style={{ lineHeight: '2.5em' }}>
                                <input type="radio" id="r1" name="rg" className="k-radio" defaultChecked={true} />
                                <label className="k-radio-label" htmlFor="r1">Radio 1</label><br />
                                <input type="radio" id="r2" name="rg" className="k-radio" />
                                <label className="k-radio-label" htmlFor="r2">Radio 2</label><br />
                                <input type="radio" id="r3" name="rg" className="k-radio" />
                                <label className="k-radio-label" htmlFor="r3">Radio 3</label>
                            </p>
                        </div>
                    </div>
                </Ripple>
            </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-ripple
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { Ripple } from '@progress/kendo-react-ripple';
    // CommonJS format
    var { Ripple } = require('@progress/kendo-react-ripple');
  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 Ripple package requires the following peer dependencies that have to be installed by your application:

  • react
  • react-dom

In this article