Defined in: format.ts:367
Options for formatting hotkeys for display.
optional alternatesSeparator?: string;Defined in: format.ts:396
Separator between the hotkeys of a hotkey object with alternates, such as ' or '. With it, the label lists every hotkey for the platform. Without it, the label shows the first one. Has no effect with parts: true.
optional isolate?: boolean;Defined in: format.ts:407
Wrap the label in the invisible Unicode characters U+2066 and U+2069, which keep its keys in left-to-right order inside right-to-left text. Each step of a sequence and each separator between steps is wrapped too. Use it on a right-to-left page where the label is part of a longer string, such as a placeholder or the text of an <option>. Where the label has its own element, set dir="ltr" on that element instead. Has no effect with parts: true. Default: false.
optional keyLabels?: Readonly<Record<string, string>>;Defined in: format.ts:385
Final display overrides for logical keys or physical codes; take precedence over layoutMap. Never changes matching.
optional layoutMap?: object;Defined in: format.ts:383
An already-resolved code-to-key map, such as KeyboardLayoutMap or Map. Used only for physical bindings. Mapped keys receive normal display formatting; missing or empty entries use conventional fallback labels. The caller owns loading and refreshing the map; this formatter never calls browser APIs.
get: (code) => string | undefined;string
string | undefined
optional parts?: boolean;Defined in: format.ts:376
Return individual key labels instead of a joined string. Default: false.
optional platform?: HotkeyPlatform;Defined in: format.ts:372
The target platform. Without it, formatForDisplay detects the platform in the browser and uses 'linux' on a server.
optional separatorToken?: string | null;Defined in: format.ts:387
Override the separator between display tokens. Defaults to platform-specific formatting when null/undefined.
optional sequenceSeparator?: string;Defined in: format.ts:389
Separator between sequence steps. Default: a space.
optional useSymbols?:
| boolean
| {
keys?: boolean;
modifiers?: boolean;
};Defined in: format.ts:374
Whether to use symbols for the display. Defaults to true.