UIFocusScopeOptions
Defined in: ui/src/types.ts:433
How one focus scope behaves, passed as UIPanelProps.focus. All four callbacks run through the UI error boundary against the host container.
Properties
Section titled “Properties”autoFocus?
Section titled “autoFocus?”
optionalautoFocus?:boolean
Defined in: ui/src/types.ts:443
Focus the first candidate in tree order the first time the scope takes
input with nothing remembered. Defaults to true.
input?
Section titled “input?”
optionalinput?:UIFocusInputOptions|null
Defined in: ui/src/types.ts:449
Rename the polled actions per role. null reads no device: the game
drives the scope through move(), activate() and cancel(). Pointer
focus and the scroll follow keep working.
modal?
Section titled “modal?”
optionalmodal?:boolean
Defined in: ui/src/types.ts:459
Own the pointer as well as the keys while this scope reads input.
Defaults to true: everything drawn outside the scope’s subtree stops
answering the pointer, and a press there is claimed for the UI and does
not reach the game’s action map. false leaves the world behind the
panel clickable.
onActivate?
Section titled “onActivate?”
optionalonActivate?: (element) =>void
Defined in: ui/src/types.ts:468
Called after the focused element’s own action has run.
Parameters
Section titled “Parameters”element
Section titled “element”Returns
Section titled “Returns”void
onCancel?
Section titled “onCancel?”
optionalonCancel?: () =>void
Defined in: ui/src/types.ts:472
Called on the cancel action and on cancel().
Returns
Section titled “Returns”void
onFocusMove?
Section titled “onFocusMove?”
optionalonFocusMove?: (element,previous) =>void
Defined in: ui/src/types.ts:466
Called after focus lands somewhere else, with both elements.
Parameters
Section titled “Parameters”element
Section titled “element”UIElement | null
previous
Section titled “previous”UIElement | null
Returns
Section titled “Returns”void
onMoveBlocked?
Section titled “onMoveBlocked?”
optionalonMoveBlocked?: (direction) =>void
Defined in: ui/src/types.ts:470
Called when a move finds nothing in that direction.
Parameters
Section titled “Parameters”direction
Section titled “direction”Returns
Section titled “Returns”void
pointerFocus?
Section titled “pointerFocus?”
optionalpointerFocus?:PointerFocusMode
Defined in: ui/src/types.ts:451
What pointer input does to focus. Defaults to "press".
scrollPadding?
Section titled “scrollPadding?”
optionalscrollPadding?:number
Defined in: ui/src/types.ts:464
Px kept between a focused element and the edge of an enclosing
UIScrollView. Defaults to 8; must be finite and at or above zero.
optionalwrap?:boolean
Defined in: ui/src/types.ts:438
Wrap to the opposite end when a move runs past the last element. Defaults
to true; false refuses the move.
Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/ui.md.