button invoketarget=”share”
I���ve written quite a bit about how I���d like to see a declarative version of the Web Share API. My current proposal involves extending the type attribute on the button element to support a value of ���share���.
Well, maybe a different attribute will end up accomplishing what I want! Check out the explainer for the ���invokers��� proposal over on Open UI. The idea is to extend the button element with a few more attributes.
The initial work revolves around declaratively opening and closing a dialog, which is an excellent use case and definitely where the effort should be focused to begin with.
But there���s also investigation underway into how this could be away to provide a declarative way of invoking JavaScript APIs. The initial proposal is already discussing the fullscreen API, and how it might be invoked like this:
button invoketarget="toggleFullsceen"They���re also looking into a copy-to-clipboard action. It���s not much of a stretch to go from that to:
button invoketarget="share"Remember, these are APIs that require a user interaction anyway so extending the button element makes a lot of sense.
I���ll be watching this proposal keenly. I���d love to see some of these JavaScript cowpaths paved with a nice smooth coating of declarative goodness.
Jeremy Keith's Blog
- Jeremy Keith's profile
- 55 followers
