Skip to content

Vizel API / core/src / formatVizelTooltip

Function: formatVizelTooltip() ​

ts
function formatVizelTooltip(label, shortcut?): string;

Defined in: packages/core/src/utils/keyboard.ts:122

Format a tooltip string with an optional keyboard shortcut.

Parameters ​

ParameterType
labelstring
shortcut?string | VizelPlatformShortcut

Returns ​

string

Example ​

ts
formatVizelTooltip("Bold", "Mod+B")  // "Bold (⌘B)" on Mac, "Bold (Ctrl+B)" on other
formatVizelTooltip("Quote")           // "Quote"

Released under the MIT License.