label | string · requiredLabel text for the input (always rendered for accessibility). |
|---|
value | number | null | undefined · requiredCurrent value of the input. |
|---|
onChange | (value: number) => void · requiredCallback fired when a valid text edit commits on blur or Enter, or when a step or clear control changes the value. |
|---|
size | 'sm' | 'md' | 'lg' · default 'md'Size variant. |
|---|
isLabelHidden | booleanVisually hide the label (still accessible to screen readers). |
|---|
description | stringDescription text displayed between the label and input. |
|---|
isOptional | booleanWhether the field is optional (mutually exclusive with isRequired). |
|---|
onKeyDown | (e: KeyboardEvent<HTMLInputElement>) => voidCallback fired on keydown events on the input. |
|---|
isRequired | booleanWhether the field is required (mutually exclusive with isOptional). |
|---|
isDisabled | booleanWhether the input is disabled. |
|---|
isReadOnly | boolean · default falseMakes the input read-only: the value is shown at full opacity and still submits with the form, but cannot be edited. Unlike isDisabled, a read-only input is not dimmed and stays in the tab order. Stepping is off in every form while read-only: arrow keys, the wheel, and the number steppers. isDisabled takes precedence when both are set. |
|---|
disabledMessage | stringExplains why the input is disabled. With isDisabled, shows a tooltip on hover/keyboard focus and keeps the input focusable via aria-disabled (the field becomes read-only). Use this instead of wrapping a disabled NumberInput in Tooltip. |
|---|
placeholder | stringPlaceholder text. |
|---|
labelTooltip | stringTooltip text to display in an info icon at the end of the label. |
|---|
startIcon | IconTypeIcon to display at the start of the input. See astryx docs icons for valid semantic names. |
|---|
labelIcon | IconTypeIcon to display before the label text. See astryx docs icons for valid semantic names. |
|---|
status | {type: 'error' | 'warning' | 'success', message?: string}Validation status with optional message. |
|---|
statusVariant | 'attached' | 'detached' | 'tooltip' · default 'attached'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing; tooltip hides the message box and surfaces it in a tooltip on the status icon. |
|---|
min | number | nullMinimum value allowed. A smaller entry commits at this value on blur or Enter. |
|---|
max | number | nullMaximum value allowed. A larger entry commits at this value on blur or Enter. |
|---|
step | number | null · default 1Step increment for the input. |
|---|
formatValue | (value: number) => stringFormats the committed value while the input is not focused. The raw numeric value is shown on focus for editing and the formatted value is exposed through aria-valuetext. |
|---|
isWheelEnabled | boolean · default trueWhether scrolling the wheel over the focused input steps the value. Disable this when page scrolling should always take priority. |
|---|
hasNumberSteppers | boolean · default falseShows increment and decrement buttons at the end of the input. |
|---|
units | string | nullUnits text to display at the end of the input (e.g., "%" or "GB"). |
|---|
isIntegerOnly | booleanOnly allow integer values (no floating point). |
|---|
hasClear | boolean · default falseShows a clear (×) button when the input has a value. When true, the onChange callback also accepts null to signal the user cleared the input. |
|---|
htmlName | stringHTML name attribute for form submissions. |
|---|
autoComplete | stringHTML autocomplete attribute. |
|---|
width | SizeValueWidth of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned. |
|---|
hasAutoFocus | booleanWhether to focus the input on mount. |
|---|
onFocus | (e: FocusEvent<HTMLInputElement>) => voidCallback fired when the input receives focus. |
|---|
onBlur | (e: FocusEvent<HTMLInputElement>) => voidCallback fired when the input loses focus. |
|---|
onEnter | () => voidCallback fired when the user presses the Enter key. |
|---|