How to create a Tooptip for an SvgIcon

1 Answer 110 Views
SvgIcon Tooltip
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Grant asked on 14 Nov 2024, 11:09 AM

Hi, 

Like my title says imtrying to create a KendoReact Tooltip around a SvgIcon.

I tried these 3 options, but have not been successful:

<Tooltip
  anchorElement="target"
  position="top"
>
   <SvgIcon icon={xIcon} />
</Tooltip>
<Tooltip
  anchorElement="target"
  position="top"
>
  <span title={'test'}>
    <SvgIcon icon={xIcon} />
  </span>
</Tooltip>
<Tooltip
  anchorElement="target"
  position="top"
>
  <span title={'test'}>
    <SvgIcon icon={xIcon}>
      <title>TEst</title>
    </SvgIcon>
  </span>
</Tooltip>

Please advise.

Thanks,
Grant

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Vessy
Telerik team
answered on 18 Nov 2024, 10:35 AM

Hi, Grant,

To add a tooltip to the SVG component you need to configure its title atribute. Please, note, that the svg element of the xIcon is pretty thin, therefore it might be hard to hover it and show tooltip but it is there, you can see a video from my test there:

Below you can see the sample I used for my test, I hope it will be helpful for you:

      <Tooltip anchorElement="target" position="top">
        <SvgIcon icon={xIcon} title="close" size="large" />
      </Tooltip>

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
SvgIcon Tooltip
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Vessy
Telerik team
Share this question
or