overlays
Tailwind CSS Tooltip
A tooltip is a helpful tool that displays a message when you hover over an element.
Utilize the class tooltip
as the target for JavaScript to address the tooltip component, and use the component class tooltip-content
for the tooltip container. Apply the Tailwind CSS display utility classes opacity-100
and visible
to the tooltip-shown:
modifier to toggle the visibility of the tooltip and make it visible.
Apply the component class tooltip-toggle
to a button or any other element to trigger the appearance of the tooltip upon hovering.
Include any text or markup within the component class tooltip-body
that you wish to display in the tooltip.
Use below given example for default tooltip on hover.
Use modifier class tooltip-{semantic-color}
with component class tooltip-body
for colored tooltip.
Utilize the JavaScript option class [--placement:{direction}]
to specify the tooltip placement in various directions. Here, direction
can be top
, bottom
, left
, or right
. By default, the tooltip is positioned at the top
.
Please utilize the provided example for creating an image tooltip.
The Himalayas About Himalayas The Great Himalayan mountain ranges in the Indian sub-continent region. Read more , Asia's towering mountain range, separates the Indian subcontinent from the Tibetan Plateau. Mount Everest, Earth's highest peak, and over 100 others surpass 7,200 m. Spanning Nepal, China, Pakistan, Bhutan, and India, they birth major rivers like the Indus and the Ganges. Home to 600 million people, they shape South Asian and Tibetan cultures.
Below given example shows user details tooltip upon hover.
Lead Software Architect.
ABC Technologies
Below given example shows descriptive tooltip upon hover.
- Welcome to FlyonUI. If you continue to browse and use this TailwindCSS component library, you are agreeing to comply with and be bound by the following terms and conditions of its use.
- The content of the pages of this website is for your general information and use only. It is subject to change without notice.
- This website uses cookies to monitor browsing preferences. If you do allow cookies to be used, the following personal information may be stored by us for use by third parties.
- Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness, or suitability of the information and materials found or offered on this website for any particular purpose.
- Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services, or information available through this website meet your specific requirements.
The HSTooltip
object is contained within the global window
object.
Below is a demonstration of how to use the public methods. Apply the ID to the tooltip
component class and target it using the methods. We’ve included JavaScript for a public method, enabling it to function when the method
button is clicked. To test other methods, copy and paste the following code into your console, then click the button.
Force show tooltip (public method).
Force show tooltip (static method).
Open item (mixed).
Below is a demonstration of how to use the event. We’ve included JavaScript to handle the events, allowing it to execute when the corresponding event is fired. To test these events, monitor your console.
An example where a function is run every time a tooltip shows.