Selector
Render a single-value Astryx selector.
Astryx Props
JSON-safe Selector props forwarded to Astryx.
Supported Astryx props include:
label(string; required): Label text for accessibility.options(SelectorOption[]; required): Array of items: strings, objects with value/label/icon/disabled, dividers ({type: "divider"}), or sections ({type: "section", title, items}).value(string): Currently selected value.onChange((value: string) => void): Callback fired when the selection changes.hasClear(boolean): Shows a clear (x) button when a value is selected. When true, onChange also accepts null to signal the user cleared the selection.hasSearch(boolean): Whether to show a search input for filtering options.searchPlaceholder(string): Placeholder text for the search input.placeholder(string): Placeholder text shown when no value is selected.size('sm' or 'md' or 'lg'): Size variant for the selector.isDisabled(boolean): Disables the selector.isLabelHidden(boolean): Visually hides the label while keeping it accessible.description(string): Helper text displayed below the label.isOptional(boolean): Marks the field as optional.isRequired(boolean): Marks the field as required.status({type: 'error' or 'warning' or 'success', message?: string}): Validation status with an optional message.renderOption((option: SelectorOptionData) => ReactNode): Custom render function for each selectable option in the dropdown. Use this instead of JSX children; dividers and sections are rendered by the selector.xstyle(StyleXStyles): StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value: not an inline style object like style={{}}.
Props typed as React nodes, render functions, event handlers, refs, or StyleX styles are documented for Astryx parity but cannot be serialized directly from Python unless the wrapper adapts them.
See Astryx component docs: https://astryx.atmeta.com/components/Selector.
Functions
constructor__init__(items, value=None, *, label='', label_position='top', label_width=None, disabled=False, placeholder=None, size=None, clear=None, search=None, search_placeholder=None, label_hidden=None, description=None, status=None, **props) -> NoneparamitemsIterable[Any] | Mapping[str, Any]Option records. Mappings, pairs, strings, and dictionaries are normalized.
paramvaluestr | None= NoneSynchronized component value.
paramlabelstr= ''Visible or accessible label for the component.
paramlabel_positionstr= 'top'Place the label above the control or beside it in a compact row.
paramlabel_widthint | float | str | None= NoneWidth of a left-side label. Use the same width to align sibling controls.
paramdisabledbool= FalseWhether the selector is disabled.
paramplaceholderstr | None= NonePlaceholder shown when no option is selected.
paramsizestr | None= NoneSelector size.
paramclearbool | None= NoneWhether to show a clear button.
paramsearchbool | None= NoneWhether to show option filtering.
paramsearch_placeholderstr | None= NonePlaceholder for the search input.
paramlabel_hiddenbool | None= NoneWhether to visually hide the accessible label.
paramdescriptionstr | None= NoneHelper text displayed with the selector.
paramstatusMapping[str, Any] | None= NoneValidation status record.
parampropsAny= {}Returns
None