dash-bootstrap-components icon indicating copy to clipboard operation
dash-bootstrap-components copied to clipboard

[RFC] TooltipWrapper component

Open tcbegley opened this issue 1 year ago • 0 comments

This PR implements an experimental TooltipWrapper component which attaches a tooltip to the components that it wraps rather than using IDs to match to elements in the DOM.

Example usage would be as follows.

import dash_bootstrap_components as dbc
from dash import Dash, html

app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])

app.layout = dbc.Container(
    [
        html.P("The button below has a tooltip"),
        dbc.TooltipWrapper(dbc.Button("Hover over me!"), text="test tooltip"),
    ],
    className="p-5",
)

app.run_server(debug=False)

I'm not really sure about this. It's kind of neat, but I'm not sure it really solves any major problems that the original implementation has, and I generally think it's preferable for there to not be multiple different ways of accomplishing the same thing.

tcbegley avatar Apr 14 '24 10:04 tcbegley