React Suite Popover Component
Last Updated :
23 Jun, 2022
React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. Popover Component allows the user to show the popup information that is trigger on some event over the parent window. We can use the following approach in ReactJS to use the React Suite Popover Component.
Popover Props:
- children: It is used to denote the content of the component.
- classPrefix: It is used to denote the prefix of the component CSS class.
- title: It is used to denote the title of the component.
- visible: It is used to denote the component is visible by default.
Whisper Props:
- container: It is used to set the rendering container.
- delay: It is used to denote the delay Time.
- delayHide: It is used to denote the hidden delay Time.
- delayShow: It is used to denote the show delay Time.
- enterable: It is used to indicate whether the mouse is allowed to enter the floating layer of the popover when trigger value is set to hover.
- full: It is used to denote the content full the container.
- onBlur: It is a callback function which is triggered on losing the focus.
- onClick: It is a callback function which is triggered on click event.
- onClose: It is a callback function which is triggered on closing the component.
- onEnter: It is a callback function which is triggered before the overlay transitions in.
- onEntered: It is a callback function which is triggered after the overlay finishes transitioning in.
- onEntering: It is a callback function which is triggered as the overlay begins to transition in.
- onExit: It is a callback function which is triggered right before the overlay transitions out.
- onExited: It is a callback function which is triggered after the overlay finishes transitioning out.
- onExiting: It is a callback function which is triggered as the overlay begins to transition out.
- onFocus: It is a callback function to get the focus.
- onMouseOut: It is a callback function which is triggered on mouse leave event.
- onOpen: It is a callback function which is triggered when the open component.
- placement: It is used for the placement of the component.
- preventOverflow: It is used to prevent floating element overflow.
- speaker: It is used to display the component.
- trigger: It is used for the triggering events.
- triggerRef: It is used to denote the Ref of trigger.
Whisper Methods:
- open: It is a function that is used to display the popover.
- close: It is a function that is used to hide the popover.
Creating React Application And Installing Module:
Step 1: Create a React application using the following command:
npx create-react-app foldername
Step 2: After creating your project folder i.e. foldername, move to it using the following command:
cd foldername
Step 3: After creating the ReactJS application, Install the required module using the following command:
npm install rsuite
Project Structure: It will look like the following.
Project StructureExample: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.
App.js
Step to Run Application: Run the application using the following command from the root directory of the project:
npm start
Output: Now open your browser and go to http://localhost:3000/, you will see the following output:

Example 2
In this example, we have learnt to use a Dropdown menu as a Popover
JavaScript
import React from 'react'
import 'rsuite/dist/rsuite.min.css';
import { Popover, Whisper, Button } from 'rsuite';
import { Dropdown } from 'rsuite';
export default function App() {
return (
<div style={{
display: 'block', width: 600, paddingLeft: 30
}}>
<h1 style={{color:'green'}}>GeeksforGeeks</h1>
<h4>React Suite Popover Component</h4> <br></br>
<Whisper
trigger="click"
placement='bottom'
speaker={
<Popover title="Geeks Menu">
<Dropdown.Menu >
<Dropdown.Item >New File</Dropdown.Item>
<Dropdown.Item >New File with Current Profile</Dropdown.Item>
<Dropdown.Item>Download As...</Dropdown.Item>
<Dropdown.Item >Export PDF</Dropdown.Item>
</Dropdown.Menu>
</Popover>
}
>
<Button appearance="subtle">
Click me to Open Popover
</Button>
</Whisper>
</div>
);
}
OUTPUT
Reference: https://rsuitejs.com/components/popover/
Similar Reads
React Suite Dropdown Used with Popover React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. The dropdown component allows the user to provide navigation that uses a select picker if you want to select a value. The dropdown component with popover basica
3 min read
React Suite Popover Follow Cursor React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, weâll learn about React suite Popover Follow Cur
3 min read
React Suite Popover Hide Arrow Indicator React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, weâll learn about React Suite Popover Hide Arrow
3 min read
React Suite Popover Used with Dropdown React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React suite popover placement.
3 min read
React Suite Popover Triggering events React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React suite popover placement.
3 min read
React Suite Popover Container and prevent overflow React Suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React Suite Popover Container
3 min read
React Suite Popover Placement A React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React suite popover placemen
4 min read
React Suite Popover <Whisper> Props React Suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React Suite Popover Whisper Pr
4 min read
React Suite Popover Component React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. Popover Component allows the user to show the popup information that is trigger on some event over the parent window. We can use the following approach in ReactJ
4 min read
React Suite Popover Props React Suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React Suite Popover Props. The
4 min read