Skip to main content

Type Alias: ShortcutProps

ShortcutProps = object

Defined in: packages/react/src/jsx.ts:146

Props for the Shortcut virtual element.

Defines a keyboard shortcut. Must be a child of <GtkShortcutController>.

Example

<GtkShortcutController>
<x.Shortcut trigger="<Control>s" onActivate={save} />
<x.Shortcut trigger={["F5", "<Control>r"]} onActivate={refresh} />
<x.Shortcut trigger="Escape" onActivate={cancel} disabled={!canCancel} />
</GtkShortcutController>

Properties

disabled?

optional disabled: boolean

Defined in: packages/react/src/jsx.ts:156

Whether the shortcut is disabled


onActivate()

onActivate: () => boolean | void

Defined in: packages/react/src/jsx.ts:154

Called when the shortcut is activated. Return false to indicate the shortcut was not handled; otherwise it is considered handled.

Returns

boolean | void


trigger

trigger: string | string[]

Defined in: packages/react/src/jsx.ts:148

The trigger string(s) using GTK accelerator format (e.g., "<Control>s", "F1")