All Components

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

Popup Overview

The Kendo UI Popup is a React component that positions a piece of content next to a specific anchor component.

Basic Usage

The following example demonstrates the Popup in action.

<style>
  .popup-content {
    padding: 30px;
    color: #787878;
    background-color: #fcf7f8;
    border: 1px solid rgba(0,0,0,.05);
  }
</style>
class AppComponent extends React.Component {
       anchor = null;
       constructor(props) {
           super(props);
           this.state = { show: false };
       }

       componentDidMount() {
           this.setState({show: true});
       }

       render() {
           return (
               <div>
                   <button
                       className="k-button"
                       onClick={this.onClick}
                       ref={(button) => {
                           this.anchor = button;
                       }}
                   >
                       {this.state.show ? 'Hide' : 'Show'}
                   </button>
                   <Popup
                       anchor={this.anchor}
                       show={this.state.show}
                       popupClass={'popup-content'}
                   >
                       Popup content.
                   </Popup>
               </div>
           );
       }

       onClick = () => {
           this.setState({ show: !this.state.show });
       }
   }

   ReactDOM.render(
       <AppComponent />,
       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-popup
  2. Once installed, import the package module.

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

  • react
  • react-dom

Functionality and Features

In this article