[charts][RFC] Tooltip deprecation path #15095
Labels
breaking change
component: charts
This is the name of the generic UI component, not the React module!
RFC
Request For Comments
The history during v7
Customizing the tooltip has been a long battle with multiple attempts
Initially, the tooltip had 3 places to override:
The two last have been deprecated in favor of
slots.itemContent
andslots.axisContent
for consistency.It appeared that slots was not optimal for tooltip for two reasons:
The last solution
We propose to provide a new composition approach (see docs examples)
With this solution we export
useItemTooltip
anduseAxisTooltip
. They provide the basics data needed to reproduce our tooltip.If additional data is required, they can use additional hooks to select data from the container. For example:
Breaking changes
Option 1
I would personally be in favor of dropping at the same time
slots.popper
,itemContent
,slots.itemContent
,axisContent
, andslots.axisContent
. And rely on compositionBut the step might be too big for the users.
Option 2
Another option is to remove the
itemContent
, andaxisContent
. Deprecate theslots.itemContent
andslots.axisContent
, encouraging users to set them tonull
and use composition as a transition period.It's less breaking change forced to do, but the DX looks crap.
Option 3
Remove all current way to customize tooltip, and provide a
slots.tooltip
that override the default one.The text was updated successfully, but these errors were encountered: