Skip to content
Binary UIKit reference Stable

SelectionActions

Controlled workflow for applying an instruction to selected text, then accepting, rejecting, or retrying its result.

Use SelectionActions for a controlled edit to selected text. Keep the selection visible. Show a preview before acceptance. Preserve errors until retry or rejection. Supply one announcement for each semantic transition.

Interactive example

Loading interactive example

API

Inherited prop contracts

  • Omit<HTMLAttributes<HTMLDivElement>, 'children'> Props from this native base are accepted except the listed members.
MemberTypeKindRequiredDefault
anchorIdstringpropNoundefined
announcementstringpropNoundefined
errorSnippetsnippetNoundefined
instructionsreadonly SelectionInstruction[]propYes
labelsSelectionActionsLabelspropYes
onAccept() => voidcallbackYes
onInstruction(instruction: SelectionInstruction) => voidcallbackYes
onReject() => voidcallbackYes
onRetry() => voidcallbackYes
previewSnippetsnippetNoundefined
selectedTextstringpropYes
stateSelectionActionsStatebindingNo'idle'

Examples

Source

Loading source