Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom dropdown trigger #561

Open
mrlubos opened this issue Feb 21, 2025 · 2 comments
Open

Custom dropdown trigger #561

mrlubos opened this issue Feb 21, 2025 · 2 comments

Comments

@mrlubos
Copy link

mrlubos commented Feb 21, 2025

Is your feature request related to a problem? Please describe.

Hey! First of all, a very clean library, so thank you for creating it. So far, there's only one thing I'm missing. If you've used packages such as @headlessui/react, they allow you to pass custom components throughout the library using the as prop. See the docs for <MenuButton /> for example.

Describe the solution you'd like

I'd like a similar feature as I have my fancy button with extra functionality and I am unable to use it as a dropdown trigger. Even if I pass it as a child, it still does't work and it creates invalid HTML since nesting two <button> tags is illegal.

Describe alternatives you've considered

Painfully using class and custom children logic to recreate an existing button.

Additional context

  • none
@GiyoMoon
Copy link
Member

Kobalte has the as prop too! See https://kobalte.dev/docs/core/overview/polymorphism

@mrlubos
Copy link
Author

mrlubos commented Feb 21, 2025

Oh awesome @GiyoMoon! In that case I'd consider mentioning it explicitly as part of every API as that's what I've been looking at and hence missed it. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants