AnyLumino
API referenceastryxsurfaces

Field

Wrap a custom control with an Astryx field label.

Astryx Props

JSON-safe Field props forwarded to Astryx.

Supported Astryx props include:

  • label (string; required): Label text for the field (always rendered for accessibility).
  • inputID (string; required): ID for the input element (used for the label htmlFor attribute).
  • children (ReactNode; required): The input or control to render.
  • isLabelHidden (boolean): Visually hide the label (still accessible to screen readers).
  • isDisabled (boolean): Whether the associated input is disabled. Propagates disabled styling to the label.
  • description (string): Description text displayed between the label and input.
  • descriptionID (string): ID for the description element (use for aria-describedby on the input).
  • isOptional (boolean): Whether the field is optional (mutually exclusive with isRequired).
  • isRequired (boolean): Whether the field is required (mutually exclusive with isOptional).
  • labelIcon (IconType): Icon to display before the label text. See 'npx astryx docs icons' for valid semantic names.
  • labelTooltip (string): Tooltip text to display in an info icon at the end of the label.
  • status (FieldStatus): Status indicator with type and optional message. When message is set, displays a colored status box.
  • statusVariant ('attached' or 'detached'): How the status message renders relative to the input. Attached overlaps the input border; detached floats below.
  • width (SizeValue): Width of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned. Prefer this over setting width via xstyle/className/style, which only size the inner control box.
  • ref (React.Ref<HTMLDivElement>): Ref forwarded to the root element.
  • xstyle (StyleXStyles): StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value: not an inline style object like style={{}}.
  • className (string): CSS class name(s) appended to the root element. Prefer xstyle for StyleX deduplication.
  • style (React.CSSProperties): Inline styles applied to the root element. Takes priority over StyleX inline styles.

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/Field.

Functions

constructor__init__(children=None, *, label, input_id='', description='', status=None, disabled=False, label_hidden=None, optional=None, required=None, status_variant=None, width=None, **props) -> None
paramchildrenChildInput
= None

Child widget, sequence of widgets, or mapping of slot names to widgets.

paramlabelstr

Visible or accessible label for the component.

paraminput_idstr
= ''

ID associated with the wrapped input element.

paramdescriptionstr
= ''

Supporting description text.

paramstatusMapping[str, Any] | None
= None

Validation or status record displayed by Astryx.

paramdisabledbool
= False

Whether the component should render disabled.

paramlabel_hiddenbool | None
= None

Whether to visually hide the accessible label.

paramoptionalbool | None
= None

Whether to mark the field optional.

paramrequiredbool | None
= None

Whether to mark the field required.

paramstatus_variantstr | None
= None

Attached or detached status presentation.

paramwidthint | float | str | None
= None

Width of the complete field.

parampropsAny
= {}

Returns

None

On this page