mnkhouri / react-circular-slider

A circular slider component for React
https://marc.khouri.ca/react-circular-slider/
22 stars 22 forks source link

Tooltips to handle #36

Open aalejandromr opened 9 months ago

aalejandromr commented 9 months ago

Is there a way to add a tooltip to the tooltip to the handle? Like so

image
mnkhouri commented 9 months ago

Unfortunately that functionality doesn't exist. I think one could add it, this is where we render the handle: https://github.com/mnkhouri/react-circular-slider/blob/40e78d5eb88f8fa670ec492658663b4a5fad403d/src/index.tsx#L379-L385

So you could use the handle1Position.x and handle1Position.y to render a tooltip below the handle.

Or perhaps it would be best to accept a tooltip parameter instead of rendering one directly, then callers could pass in whatever tooltip design they prefer