All Components

This website hosts native Kendo UI components, built from the ground up with the ultimate performance in mind, intended to be used in the React ecosystem.

Animation Overview

The Animations use the TransitionGroup component to animate elements which appear, enter, or exit the viewport.

Basic Usage

The following example demonstrates the Fade, Expand, Push, Reveal, Slide, and Zoom Animation in action.

<style>
 .content {
   width: 100px;
   padding: 10px;
   color: #787878;
   background-color: #fcf7f8;
   font-size: 13px;
   font-family: Helvetica, Arial, sans-serif;
   letter-spacing: 1px;
   text-align: center;
   border: 1px solid rgba(0,0,0,.05);
 }
 .k-radio-label {
     line-height: 1.2;
     margin-bottom: .5rem;
 }
 </style>
class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            animationType: 'slide',
            show: false
        };
    }

    handleSelect = (event) => {
        this.setState({ animationType: event.target.value });
    }
    render() {
        const { show } = this.state;

        const children = show ? (
            <div
                className="content"
            >Content
            </div >) : null;

        let animation;

        switch (this.state.animationType) {
            case 'slide':
                animation = (<Slide >{children}</Slide>);
                break;
            case 'push':
                animation = (<Push >{children}</Push>);
                break;
            case 'expand':
                animation = (<Expand >{children}</Expand>);
                break;
            case 'fade':
                animation = (<Fade >{children}</Fade>);
                break;
            case 'zoom':
                animation = (<Zoom >{children}</Zoom>);
                break;
            case 'reveal':
                animation = (<Reveal >{children}</Reveal>);
                break;
            default: animation = (<Slide >{children}</Slide>); break;
        }

        return (
            <div className="example-wrapper row">
                <div className="col-xs-12 col-sm-6 example-col">
                    {animation}
                </div>
                <div className="col-xs-12 col-sm-6 example-config">
                    <input
                        onClick={this.handleSelect}
                        id="slide"
                        className="k-radio"
                        name="type"
                        type="radio"
                        value="slide"
                        defaultChecked={true}
                    />
                    <label htmlFor="slide" className="k-radio-label">
                        &nbsp;Slide
                    </label>
                    <br />
                    <input
                        onClick={this.handleSelect}
                        name="type"
                        id="push"
                        className="k-radio"
                        type="radio"
                        value="push"
                    />
                    <label htmlFor="push" className="k-radio-label">
                        &nbsp;Push
                    </label>
                    <br />
                    <input
                        onClick={this.handleSelect}
                        name="type"
                        id="expand"
                        className="k-radio"
                        type="radio"
                        value="expand"
                    />
                    <label htmlFor="expand" className="k-radio-label">
                        &nbsp;Expand
                    </label>
                    <br />
                    <input
                        onClick={this.handleSelect}
                        name="type"
                        id="fade"
                        className="k-radio"
                        type="radio"
                        value="fade"
                    />
                    <label htmlFor="fade" className="k-radio-label">
                        &nbsp;Fade
                    </label>
                    <br />
                    <input
                        onClick={this.handleSelect}
                        name="type"
                        id="zoom"
                        className="k-radio"
                        type="radio"
                        value="zoom"
                    />
                    <label htmlFor="zoom" className="k-radio-label">
                        &nbsp;Zoom
                    </label>
                    <br />
                    <input
                        onClick={this.handleSelect}
                        name="type"
                        id="reveal"
                        className="k-radio"
                        type="radio"
                        value="reveal"
                    />
                    <label htmlFor="reveal" className="k-radio-label">
                        &nbsp;Reveal
                    </label>
                    <br />
                    <button className="k-button" type="submit" onClick={() => this.setState({ show: !this.state.show })}>Animate</button>
                </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-animation
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { Fade } from '@progress/kendo-react-animation';
    // CommonJS format
    const { Fade } = require('@progress/kendo-react-animation');
  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 Animation package requires you to install the following peer dependencies in your application:

  • react
  • react-dom

Functionality and Features

The Push and Zoom Animations further extend the Animation component, which is commonly inherited by all Animation types, and enable you to stack animations.

In this article