Skip to content

ModalInputCustomAction

ModalInputCustomAction = object

A modal input button you label yourself.

The shorthand sets — 'ok', 'okcancel', 'yesno', 'yesnocancel' — cover most prompts. Pass an array of these instead where the buttons need to name what they do, and the response’s action is the id of the one the user picked.

let answer = await SketchUpApi.ui.getModalInput({
message: 'We could not reach the server.',
actions: [
{ id: 'retry', label: 'Retry' },
{ id: 'cancel', label: 'Cancel', style: 'secondary' },
],
});

SDK 2.35.4 Protocol 1.25.2

id: string

Comes back as the response’s action. Unique among the actions you pass.


label: string

Shown on the button as written, so localize it yourself.


optional style?: "primary" | "secondary" | "danger"

'danger' marks an action that cannot be undone. Defaults to 'primary'.