Opinion poll!

You have a <button>, it makes a <foo> open. What would be the best declarative attribute for the button to control the foo?

<button clickaction=open
17.1%
<button invokeaction=open
42.1%
<button command=open
26.3%
Other (comment ideas)
14.5%
Poll ended at .
@keithamus I'm slightly confused by this - would there then be another attribute that gives the id of the <foo> element?
@sarajw yes there would. It would likely be named similarly, so e.g. `clickactiontarget`, `invoketarget`, `commandtarget`, or similar.

@keithamus ok that makes sense :)

I don't much like the one with 'click' in it, as that's not the only way to activate a button.

They all seem so long, haha. Honestly otherwise however it's named I'd just be so happy to code stuff up like that. So neat. So simple!

@sarajw full disclosure we've been working on the idea for a while: https://open-ui.org/components/invokers.explainer

This is a last minute look at the API naming!

Invoker Commands (Explainer) | Open UI

Open UI

@keithamus thank you! Yeah if I was at my computer and not my phone I might have gone looking myself - you did post an article about it a while back I think? I love the whole thing.

@keithamus and can't we have the attribute be called `action` even if one already exists in <form>s?

So maybe like:

```
<button action="open" controls="my-dialog-id">Show options</button>
```

I guess for a dialog we might also have a "showModal" action available... 🤔

@sarajw it might be confusing with forms, but if I'm happy to try if there's a strong desire from the community.
@keithamus it just seems perfectly fitting to me. And I used "controls" because I was thinking of aria, but just target would be great.
@sarajw @keithamus So one thing to add is there's a 2nd type of 'thingy' which acts on interest (hover/focus/etc) rather than invoke(click), and the idea is they could be used at the same time. Not to say 'action' is bad but it's worth considering that bit too.

@Lukew @keithamus interesting! Fair play, naming is hard and I'm an outsider just speaking my mind :)

I'm stoked for this though. Feels like how buttons *should* work. But if inline JavaScript was a security issue, how is this safer? Just a lot less flexible and more hardwired?

@sarajw @Lukew yes it's just passing string values around, so no JS executed from HTML. Of course you can add JS to read the string values.
@sarajw @keithamus Fwiw showModal is one of the proposed actions :)
@Lukew @keithamus excellent, consider me fully on board, tell me where I can star/thumbs up/boost/comment to help it along, and I'm so there
@sarajw @Lukew by voting and replying to this you've already helped immensely! This is great feedback, thank you!
@keithamus @Lukew then you're very welcome! I'm no authority but happy to help in any way