How can I style Material-UI's tooltip text? The default tooltip on hover comes out black with no text-wrap. Is it possible to change the background, color etc? Is this option even available?
相关问题
- Align typography component to the right
- react-vega and react-vega tooltips
- CSS: element should get max-width before breaking
- How do I layout forms in MaterialUI?
- Change onHover colour of TextField Material-UI v1
相关文章
- How to get a Component's own ElementRef for re
- Material-UI [v0.x] RaisedButton on hover styles
- How do use bootstrap tooltips with React?
- Bootstrap input field inside tooltip popover remov
- Compile error using the Component Lab > Autocomple
- background-image in react component
- Is it possible to add a custom hover color to Rais
- How Can I Mask My Material-UI TextField?
This answer is out of date. This answer was written in 2016 and Material-UI has gone through significant changes since then. Please see this answer for an approach that works with the current version (3.9.2 at this time).
well, you can change the text color and the element background customizing the mui theme.
color
- is the text colorrippleBackgroundColor
- is the tooltip bbackgroundExample: Using
IconButton
- but you could you theTooltip
directly..You can also pass a
style
object for theTooltip
(inIconButton
it'stooltipStyles
) - but these styles will only be applied for the root element.It's not possible yet to change the label style to make it wrap in multiple lines.
The accepted answer on this question appears to be out-of-date (it was for a very early version of Material-UI). Below I've copied in my answer from Material UI's Tooltip - Customization Style
Below are examples of how to override all tooltips via the theme, or to just customize a single tooltip using withStyles. The second approach could also be used to create a custom tooltip component that you could reuse without forcing it to be used globally.
Here is a working example:
Here is documentation on tooltip CSS classes available to control different aspects of tooltip behavior: https://material-ui.com/api/tooltip/#css
Here is documentation on overriding these classes in the theme: https://material-ui.com/customization/themes/#css