Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(theming/shortcuts): improve #3259

Merged
merged 4 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/content/1.getting-started/3.theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@ export default defineAppConfig({
loadingIcon: 'i-octicon-sync-24'
}
},
inputMenu: {
default: {
selectedIcon: 'i-octicon-check-24',
trailingIcon: 'i-octicon-chevron-down-24'
}
},
select: {
default: {
loadingIcon: 'i-octicon-sync-24',
Expand Down Expand Up @@ -424,6 +430,9 @@ export default defineAppConfig({
sortButton: {
icon: 'i-octicon-arrow-switch-24'
},
expandButton: {
icon: 'i-octicon-chevron-down-24'
},
loadingState: {
icon: 'i-octicon-sync-24'
},
Expand Down Expand Up @@ -457,6 +466,21 @@ export default defineAppConfig({
default: {
divider: 'i-octicon-chevron-right-24'
}
},
carousel: {
default: {
prevButton: {
icon: 'i-octicon-chevron-left-24'
},
nextButton: {
icon: 'i-octicon-chevron-right-24'
}
}
},
toggle: {
default: {
loadingIcon: 'i-octicon-sync-24'
}
}
}
})
Expand Down
24 changes: 14 additions & 10 deletions docs/content/1.getting-started/4.shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,22 @@ defineShortcuts({
Shortcuts keys are written as the literal keyboard key value. Combinations are made with `_` separator. Chained shortcuts are made with `-` separator.

Modifiers are also available:
- `meta`: acts as `Command` for MacOS and `Control` for others
- `ctrl`: acts as `Control`
- `shift`: acts as `Shift` and is only necessary for alphabetic keys
| Modifier | Description |
|----------|-------------|
| `meta` | Acts as `Command (⌘)` on macOS and `Control (Ctrl)` on Windows/Linux. |
| `ctrl` | Represents the `Control (Ctrl)` key across all operating systems. |
| `shift` | Represents the `Shift` key, only needed for alphabetic keys (e.g., `shift_e`). |

Examples of keys:
- `escape`: will trigger by hitting `Esc`
- `meta_k`: will trigger by hitting `⌘` and `K` at the same time on MacOS, and `Ctrl` and `K` on Windows and Linux
- `ctrl_k`: will trigger by hitting `Ctrl` and `K` at the same time on MacOS, Windows and Linux
- `shift_e`: will trigger by hitting `Shift` and `E` at the same time on MacOS, Windows and Linux
- `?`: will trigger by hitting `?` on some keyboard layouts, or for example `Shift` and `/`, which results in `?` on US Mac keyboards
- `g-d`: will trigger by hitting `g` then `d` with a maximum delay of 800ms by default
- `arrowleft`: will trigger by hitting `←` (also: `arrowright`, `arrowup`, `arrowdown`)
| Shortcut Key | Action |
|---------------|--------|
| `escape` | Triggers when `Esc` is pressed |
| `meta_k` | `⌘ + K` on Mac, `Ctrl + K` on Windows/Linux |
| `ctrl_k` | Triggers `Ctrl + K` on all OS |
| `shift_e` | Triggers `Shift + E` on all OS |
| `?` | Triggers `?` (Shift + `/` on US Mac keyboards) |
| `g-d` | Triggers when `g` then `d` are pressed within 800ms |
| `arrowleft` | Triggers when `←` is pressed (also: `arrowright`, `arrowup`, `arrowdown`) |

::callout{icon="i-heroicons-light-bulb"}
For a complete list of available shortcut keys, refer to the [`KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) API docs. Note the `KeyboardEvent.key` has to be written in lowercase.
Expand Down