Overview
Dictation supports two modes and a small callback contract. All callbacks receive{ fieldId, text }.
This guide follows Dictation Modes, Callback Contract, and ShowOptions in Suki Dictation SDK.md.
Dictation modes
| Mode | Behavior |
|---|---|
in-field | Overlays the input container; provide rootElement when possible |
scratchpad | Floating standalone dictation UI when dictation is not tied to a specific field |
JavaScript
scratchpad when dictation is not tied to a specific input field.
Callback contract
Payload shape for every callback:JavaScript
| Callback | Required | Purpose |
|---|---|---|
onSubmit | Yes | Commit dictation result |
onCancel | No | Discard session |
onDraft | No | Intermediate updates while the user dictates |
JavaScript
ShowOptions summary
| Field | Required | Description |
|---|---|---|
mode | Yes | "in-field" or "scratchpad" |
fieldId | Yes | Identifier echoed in callbacks |
rootElement | Recommended | Container for the iframe |
initialText | No | Seed content |
onSubmit | Yes | Completion callback |
onCancel | No | Cancellation callback |
onDraft | No | Incremental updates |
Next steps
- JavaScript integration for
show()and switching fields - React integration for
Dictationprops - Error handling if callbacks or layout behave unexpectedly