S
SolidJS9mo ago
Eatham

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
Jasmin
Jasmin9mo ago
Can't you just do <Tooltip.Trigger as={YourOwnComponent} />? https://kobalte.dev/docs/core/overview/polymorphism
Eatham
EathamOP9mo ago
Ohhh thanks!
Jasmin
Jasmin9mo ago
you're welcome :zzz_flushedfroge:
Want results from more Discord servers?
Add your server