Using Chooser and ActorChooser
This tutorial covers building selectable lists with the generic Chooser<T> and the party‑focused ActorChooser wrapper.
What you’ll learn
Render a vertical list navigated with UP/DOWN and confirmed with OK.
Highlight the selected row and handle selection/highlight events.
Build a party selector using
ActorChooserwithPartyMemberFull/PartyMemberCompact.
Chooser<T> at a glance
Chooser<T> at a glanceFile: menus/src/components/Chooser.tsx

Props
items: T[]children: (item: T, selected: boolean) => React.ReactNodehasFocus: booleanonItemSelected?(item: T, index: number)onItemHighlighted?(item: T, index: number)resetSelection?: boolean
Input
Uses
InputContextinternally and listens toUP,DOWN, andOKwhenhasFocusis true.
Example: simple string menu
ActorChooser
ActorChooserFile: menus/src/components/ActorChooser.tsx

Props
Inherits
BaseMenuScreenProps(pageData,isTestMenu,hasFocus)onActorSelected(actor: any)useFullView?: boolean— toggles betweenPartyMemberFullandPartyMemberCompact
Behavior
Reads party members from
props.pageData.runtime.gameParty.members().Internally uses
Chooserand renders either full or compact member cards.
Example: pick a party member
Tips
Pass
hasFocus={true}only when the chooser should accept input (e.g., no modal on top).Use
resetSelectionwhen swapping data sets to ensure the selection returns to 0.ActorChooserrows are wrapped inmobx-react-liteobservers, so UI reacts to live stat changes.
See also
Last updated