This is a migrated thread and some comments may be shown as answers.

Style the tooltip

2 Answers 487 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lukas
Top achievements
Rank 1
Lukas asked on 23 Jun 2020, 06:42 AM

Hi  everybody

I was wondering how to style the tooltip, preferrably with styled components. It should have a white background and black font color. The text should spread over 3 lines and the tooltip should have a drop shadow.

But this looks not at all what I expect.

const StyledTooltip = styled(Tooltip)`
  background: white;
  color: black;
  height: 116px;
`;

 

I don't need a full solution, but a hint, how to style the tooltip.

Thanks in advance

Lukas

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Silviya
Telerik team
answered on 23 Jun 2020, 07:32 AM

Hi Lukas,

The Tooltip component renders in such a way that multiple nested elements are induced. By default, the set styles are passed to the top DOM element of the KendoReact component.

So, in this case, you will need to style the nested elements as it's described in this section: https://www.telerik.com/kendo-react-ui/components/styling/styled-components/#toc-styling-nested-elements.

And here is a sample demo to illustrate the desired result based on the screenshot:

https://stackblitz.com/edit/react-vkxyyc?file=app/main.jsx

I hope this helps. Let me know if you need any additional information.

Best Regards,
Silviya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Lukas
Top achievements
Rank 1
answered on 23 Jun 2020, 08:35 AM
Thank you very much for this quick reply. This is exactly what I needed.
Tags
General Discussions
Asked by
Lukas
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Lukas
Top achievements
Rank 1
Share this question
or