excid3 / tailwindcss-stimulus-components

A set of StimulusJS components for TailwindCSS apps similar to Bootstrap JS components.

Home Page:https://excid3.github.io/tailwindcss-stimulus-components/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toggle feature cannot have multiple divs to have different status

zben opened this issue · comments

commented

I have 2 divs that I wanna toggle. Div A starts as hidden and Div B starts as not hidden. When I click button, I want A to show and B to hide. The current toggle feature assumes a global data-toggle-open-value. Is it possible to set data-toggle-open-value per child div? or just look at if the div has hidden class or not and toggle them individually? I think that will be more flexible.

This will be really helpful if I want to have swapping effect and switch between 2 sets of content.