@@ -1400,3 +1400,90 @@ def panel_absolute(
14001400 ** kwargs ,
14011401 ),
14021402 )
1403+
1404+
1405+ # ======================================================================================
1406+ # Tooltips and popovers
1407+ # ======================================================================================
1408+
1409+
1410+ def tooltip (
1411+ * ,
1412+ id : Optional [str ] = None ,
1413+ placement : Literal ["auto" , "top" , "right" , "bottom" , "left" ] = "auto" ,
1414+ options : Optional [dict [str , object ]] = None ,
1415+ ** kwargs : TagAttrValue ,
1416+ ) -> RecallContextManager [Tag ]:
1417+ """
1418+ Context manager for a tooltip
1419+
1420+ This function wraps :func:`~shiny.ui.tooltip`.
1421+
1422+ Display additional information when focusing (or hovering over) a UI element.
1423+
1424+ Parameters
1425+ ----------
1426+ id
1427+ A character string. Required to reactively respond to the visibility of the
1428+ tooltip (via the `input[id]` value) and/or update the visibility/contents of the
1429+ tooltip.
1430+ placement
1431+ The placement of the tooltip relative to its trigger.
1432+ options
1433+ A list of additional [Bootstrap
1434+ options](https://getbootstrap.com/docs/5.3/components/tooltips/#options).
1435+ """
1436+
1437+ return RecallContextManager (
1438+ ui .tooltip ,
1439+ kwargs = dict (
1440+ id = id ,
1441+ placement = placement ,
1442+ options = options ,
1443+ ** kwargs ,
1444+ ),
1445+ )
1446+
1447+
1448+ def popover (
1449+ * ,
1450+ title : Optional [TagChild ] = None ,
1451+ id : Optional [str ] = None ,
1452+ placement : Literal ["auto" , "top" , "right" , "bottom" , "left" ] = "auto" ,
1453+ options : Optional [dict [str , object ]] = None ,
1454+ ** kwargs : TagAttrValue ,
1455+ ) -> RecallContextManager [Tag ]:
1456+ """
1457+ Context manager for a popover
1458+
1459+ This function wraps :func:`~shiny.ui.popover`.
1460+
1461+ Display additional information when clicking on a UI element (typically a
1462+ button).
1463+
1464+ Parameters
1465+ ----------
1466+ title
1467+ A title to display in the popover. Can be a character string or UI elements
1468+ (i.e., tags).
1469+ id
1470+ A character string. Required to reactively respond to the visibility of the
1471+ popover (via the `input[id]` value) and/or update the visibility/contents of the
1472+ popover.
1473+ placement
1474+ The placement of the popover relative to its trigger.
1475+ options
1476+ A list of additional [Bootstrap
1477+ options](https://getbootstrap.com/docs/5.3/components/popovers/#options).
1478+ """
1479+
1480+ return RecallContextManager (
1481+ ui .popover ,
1482+ kwargs = dict (
1483+ title = title ,
1484+ id = id ,
1485+ placement = placement ,
1486+ options = options ,
1487+ ** kwargs ,
1488+ ),
1489+ )
0 commit comments