reactjsfluent-uifluentui-reactoffice-ui-fabric-react

How to set font color of ToolTip in fluent-ui


Not able to set font color of ToolTipHost in fluent-ui, I tried below code but it is not working.

<TooltipHost content="Tooltip Content"
    calloutProps: {
      styles: {
        calloutMain: { background: 'red',color:'white' },
      },
    },
/>

Solution

  • Use tooltipProps and styles inside it:

    <TooltipHost
       ...
       tooltipProps={{
         styles: {
           content: { color: '#f00' }
         }
       }}
    />
    

    Full working example Codepen.