Targets and Actions

Sometimes, or quite often I want to control one item with an element.

I think it would be great to have a component called Target that wraps a special tag around the element you want to target for some action. Then a second component called Action that can control any Targets on the page.

So let’s say i have a button or an a tag in the bottom right of my page, i want to make a div or a span on my page in the top left toggle visibility to show/hide when the button is clicked.
I could wrap the Target component around the div / span i want to show/hide and wrap an Action tag around my button / a tag.

Hope this makes sense, as it is already similar to how a modal works for instance, i just want that same sort of functionality for any chosen element regardless of if it is a modal or whatever.

Community Page
Last updated: