React Suite <Tooltip> Props
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 tooltip component allows the user to display informative text when users hover over, focus on, or tap an element. The tooltip props are used to add property values to the tooltip element.
- children: It is used to denote the primary content.
- classPrefix: It is used to denote the prefix of the component CSS class.
- visible: It is used to indicate whether the component is visible or not.
- arrow: Whether show the arrow indicator
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:
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:
Example 1: Now write down the following code in the App.js file. Here, App is our default component where we have written our code. In this example, we will learn about prop: arrow. When it is set to false, it won’t display an arrow.
Step to Run Application: Run the application using the following command from the root directory of the project:
Output: Now open your browser and go to http://localhost:3000/, you will see the following output:
Example 2: In this example, we will learn about another prop; classPrefix. You will see, how the styling of tooltip will be changed like that of a placeholder.
Please Login to comment...