@forter/hotkey
v1.4.4
Published
hotkey from Forter Components
Downloads
57
Readme
fc-hotkey
An element to simply add keyboard shortcuts to buttons and inputs :)
Usage
<script>
import '@forter/hotkey';
</script>
<fc-hotkey keys="ctrl+z">
<fc-button onclick="alert('here')"> Hotkey </fc-button>
</fc-hotkey>Examples
<!-- focus -->
<fc-hotkey keys="ctrl+z">
<fc-input></fc-input>
</fc-hotkey>
<!-- keypress -->
<fc-hotkey onkeypress="alert('keypress hotkey');" keys="ctrl+z">
Hotkeys without slotted
</fc-hotkey>Properties
| Property | Attribute | Type | Description |
|---------------|---------------|---------------------------------------------|--------------------------------------------------|
| description | description | string | Text of the shortcut for the hotkeys modal |
| keys | keys | "ctrl+c" \| "ctrl+shift+c" \| "esc,space" | key combination that will activate button click or input focus. |
| parent | parent | boolean | Indicate if parent shoulbe be clicked instead slotted |
Events
| Event |
|------------|
| keypress |
CSS Custom Properties
| Property | Description |
|--------------------------|-------------|
| --fc-hotkey-text-color | color. |
