Open In App

React .js Blueprint Popover2 Testing Animation Delays

Blueprint is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex and data-dense for desktop applications.

In this article, we’ll discuss React.js Blueprint Popover2 Testing Animation delays. Popovers help in displaying the floating content next to the target element. Sometimes hover interactions can get tricky because of the delays and transitions but these can be resolved by doing the default hover delays value to 0.



React.js BluePrint Popover2 Props:

 



Syntax:

<Popover2
    hoverCloseDelay={0} 
    hoverOpenDelay={0}
    ...
/>

Creating React Application And Installing Module:

Step 1: Create a React application using the following command:

npm create-react-app appname

Step 2: After creating your project folder i.e. appname, move to it using the following command:

cd appname

Step 3: After creating the ReactJS application, Install the required module using the following command:

npm install @blueprintjs/core

Project Structure:

 

Step 4: Run the project as follows:

npm start

Example 1: The below example demonstrates the usage of hoverOpenDelay with the value of 0 in a popover. 




import React from "react";
import "@blueprintjs/core/lib/css/blueprint.css";
import { Button } from "@blueprintjs/core";
import { Popover2 } from "@blueprintjs/popover2";
import "@blueprintjs/popover2/lib/css/blueprint-popover2.css";
  
function App() {
    return (
        <center>
            <div style={{ textAlign: "center", color: "green" }}>
                <h1>GeeksforGeeks</h1>
                <h2>
                    ReactJs Blueprint Popover2 
                    Testing Animation delays
                </h2>
            </div>
            <Popover2
                content={
                    <div style={{ 
                        backgroundColor: "#F0EFEF"
                        padding: 20 
                    }}>
                        <h2>GeeksforGeeks</h2>
                        <p>You are zeroing hoverOpenDelay.</p>
                    </div>
                }
                interactionKind="hover"
                placement="right"
                hoverOpenDelay={0}
            >
                <Button text="Hover" intent="success" />
            </Popover2>
        </center>
    );
}
  
export default App;

Output:

 

Example 2: The below example demonstrates the usage of hoverCloseDelay with the value of 0 in a popover.




import React from "react";
import "@blueprintjs/core/lib/css/blueprint.css";
import { Button } from "@blueprintjs/core";
import { Popover2 } from "@blueprintjs/popover2";
import "@blueprintjs/popover2/lib/css/blueprint-popover2.css";
  
function App() {
    return (
        <center>
            <div style={{ textAlign: "center", color: "green" }}>
                <h1>GeeksforGeeks</h1>
                <h2>
                    ReactJs Blueprint Popover2 
                    Testing Animation delays
                </h2>
            </div>
            <Popover2
                content={
                    <div style={{ 
                        backgroundColor: "#F0EFEF"
                        padding: 20 
                    }}>
                        <h2>GeeksforGeeks</h2>
                        <p>You are zeroing hoverCloseDelay.</p>
                    </div>
                }
                interactionKind="hover"
                placement="right"
                hoverCloseDelay={0}
            >
                <Button text="Hover" intent="success" />
            </Popover2>
        </center>
    );
}
  
export default App;

Output:

 

Reference: https://blueprintjs.com/docs/#popover2-package/popover2.testing


Article Tags :