Skip to content

Tooltip styling disappears when using a CustomTooltip #2795

Answered by aesakof
aesakof asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out. When providing your own content to a tooltip component, the base styling that recharts does is omitted, so you have to pass in some basic styles in the wrapperStyle prop, like so:

<Tooltip 
        content={<CustomTooltip />}
        wrapperStyle={{ backgroundColor: "white", borderStyle: "ridge", paddingLeft: "10px", paddingRight: "10px" }}
/>

Hopefully this can help someone with the same issue in the future, and maybe that example on the recharts site/codesandbox should add a wrapperStyle prop?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aesakof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant