Using Kobalte, am trying to use the Tooltip. But I don't like how the trigger is a button.
Here is the source code to the trigger: https://github.com/kobaltedev/kobalte/blob/main/packages/core/src/tooltip/tooltip-trigger.tsx
The trigger is the object the "triggers" the tooltip to appear. However I want to have the tooltip work on my own components and don't want to have my own component within a button.
So I decided to try and modify kobalte's code to work with my own. However the problem now is that I don't know the best way to implement it so that the tooltip works with anything I set to be the trigger. Thanks
GitHub
kobalte/packages/core/src/tooltip/tooltip-trigger.tsx at main · kob...
A UI toolkit for building accessible web apps and design systems with SolidJS. - kobaltedev/kobalte
3 Replies
Can't you just do
<Tooltip.Trigger as={YourOwnComponent} />
?
https://kobalte.dev/docs/core/overview/polymorphismOhhh thanks!
you're welcome :zzz_flushedfroge: