-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Opening this to track some thoughts about a potential next version of this package
Specifically I want to push developers to make more accessible keyboard shortcuts.
- Declare keyboard shortcuts directly on elements (in the general case)
- Only visible & focusable & clickable elements
- Display the shortcut on the clickable element
I'm certain there are edge cases to this, but I think you should have to opt-out of these requirements.
Draft API
In React terms, it would look something like this:
<TinyKeys
// tinykeys props
binding="$mod+KeyS" bindingLabel="$mod+S"
// button props
as={Button} onClick={save}
>
Save
</TinyKeys><button>
Save
<kbd>Ctrl+S</kbd>
</button>Save Ctrl+S
By putting the keyboard shortcut on the clickable element you know how the two types of interactions are related
I don't want to make this library very React specific though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels