Skip to content
Binary Dreams UI Kit reference SelectionActions

Selection actions

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

Loading interactive example

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. New results animate on entrance. Focus moves to the heading immediately. Reduced motion removes the animation.

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