Forms

Field API

Field wraps form controls with labels, hints, validation state, and Foundry spacing.

Preview

Used for build output.

Keep it short.

Passed validation.

Import

import { Field, Input, Select, Textarea } from "@axonyx/react";

Props

PropTypeDefaultDescription
labelReactNodeundefinedField label shown above the control.
hintReactNodeundefinedSecondary helper text.
errorReactNodeundefinedError text. Also sets error state.
state"default" | "error" | "success" | "warning"undefinedExplicit visual state.
htmlForstringautoOptional explicit label target. Falls back to child control id when available.
PropTypeDefaultDescription
uiSize"sm" | "md" | "lg""md"Shared control size for Input, Textarea, and Select.
leadingIconReactNodeundefinedLeading icon slot for Input and Select.
trailingIconReactNodeundefinedTrailing icon slot for Input.
invalidbooleanfalseMarks Input or Select as invalid without relying on parent Field state.
surface"default" | "forged""default"Available on Select for heavier admin or command-style surfaces.

CSS contract

.ax-field
.ax-field__label
.ax-field__hint
.ax-field__error
.ax-control
.ax-control__icon
.ax-input
.ax-select
.ax-textarea
[data-state]