Agata exposes Astryx Selector for one value and MultiSelector for several values. The local module is a thin package boundary: feature code passes the final Astryx contract directly, with no shadcn-style compound tree or option extraction.
Correct imports#
Do not import @astryxdesign/core/Selector, @astryxdesign/core/MultiSelector, @base-ui/react/select, or Radix-only pieces from feature code.
Single value#
Selector is controlled. Give every option a stable string value and a searchable string label.
The control owns its visible label, description, required/optional state, disabled explanation, loading state, width, and status. Do not wrap it in Field. For compact property controls, keep the exact contextual label and add isLabelHidden.
Use hasClear only when the state and callback genuinely accept null; otherwise use string | undefined for an empty placeholder state.
Rich options#
Keep option.label textual for search, type-ahead, and accessible naming. Use renderOption for a custom menu row and renderValue when the closed trigger needs the same richer presentation.
Pass raw StyleX values created by stylex.create() to xstyle. Never pass the result of stylex.props().
Multiple values#
Use MultiSelector directly for a controlled string array. Do not emulate it with multiple on another component.
Review checklist#
- Direct
SelectororMultiSelector; no compound Select slots - Exact contextual label, visible or hidden
- Textual option labels and stable string values
-
renderOption/renderValueonly for rich presentation - Controlled value uses the component's native shape
- Raw StyleX value passed to
xstyle