petalframework / petal_components

Phoenix + Live View HEEX Components
https://petal.build/components
MIT License
768 stars 84 forks source link

Add `disabled` attribute to `Tabs` `.tab` component #254

Closed jpramassini closed 10 months ago

jpramassini commented 10 months ago

I have a situation where I'd like to be able to selectively disable access to specific tabs. This requires disabling clicks (or at least linking to the underlying route the tab is connected to). Conveniently, the underlying Link component supports this attribute already and passing the disabled attribute through the .tab components already works perfectly, but raises warnings about the disabled attribute being undefined. Adding this attribute to the tabs themselves would allow for some nice free added functionality without wrestling with attribute warnings.

Happy to put up a PR for this, just wanted to make sure that was something that made sense to you before doing it.

mplatts commented 10 months ago

Hey yep a PR would be accepted for this!