DevExtreme v23.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

Tooltip

The Tooltip component can display a tooltip for an element on the page. To bind the Tooltip to an element, use the target property.

Show and Hide the Tooltip

To show and hide the Tooltip in response to certain events, specify the showEvent and hideEvent properties. These properties can accept multiple events at once as well as an object.

To hide the Tooltip when a user clicks outside its borders, use the hideOnOutsideClick property.

Customize and Animate the Tooltip

Assign the Tooltip's content in the HTML markup. Alternatively, you can use the content template to customize the Tooltip's content.

If you need to position the Tooltip at a certain side of the target element, specify the position property.

To animate the Tooltip, declare the animation object. In this object, specify the show and hide fields.

Backend API
$(() => { $('#tooltip1').dxTooltip({ target: '#product1', showEvent: 'mouseenter', hideEvent: 'mouseleave', hideOnOutsideClick: false, }); $('#tooltip2').dxTooltip({ target: '#product2', showEvent: 'mouseenter', hideEvent: 'mouseleave', hideOnOutsideClick: false, position: 'right', contentTemplate(data) { data.html("<img alt='SuperPlasma 50' width='150' src='../../../../images/products/3.png'><br/><b>SuperPlasma 50</b><br/>2400$"); }, }); $('#tooltip3').dxTooltip({ target: '#product3', showEvent: 'mouseenter', hideEvent: 'mouseleave', hideOnOutsideClick: false, position: 'top', animation: { show: { type: 'slide', from: { top: -100, opacity: 0, }, to: { opacity: 1, top: 0, }, }, hide: { type: 'pop', from: { scale: 1, opacity: 1, }, to: { opacity: 0, scale: 0.1, }, }, }, }); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/23.2.5/css/dx.light.css" /> <script src="js/dx.all.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div class="form"> <div class="label">Default mode</div> <div> <img alt="ExcelRemote IR" id="product1" src="images/products/17.png" /> <div id="tooltip1">ExcelRemote IR</div> </div> <div class="label">With template</div> <div> <img alt="SuperPlasma 50" id="product2" src="images/products/3.png" /> <div id="tooltip2"></div> </div> <div class="label">With animation</div> <div> <img alt="Projector PlusHD" id="product3" src="images/products/15.png" /> <div id="tooltip3">Projector PlusHD</div> </div> </div> </div> </body> </html>
.form { padding: 20px; } .form img { width: 100px; margin: 10px 0 30px; } .label { font-size: 16px; }