Skip to content
fayeuiStatic / 0.1.0
LLMs
API / Static edition

@fayegram-ai/faye-ui/controls/number-field

Public exports and dependency-resolved component properties, with usage and rendering guidance.

Import

import { NumberField } from '@fayegram-ai/faye-ui/controls/number-field';

Usage and behavior guide · API JSON

This entry declares a client boundary. Follow the rendering guide for framework integration.

Public exports

NameKindResolved declaration type
NumberFieldvalue{ readonly Root: typeof Root; readonly Group: { (input: Omit<import("@base-ui/react").NumberFieldGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefined; }): import("react").ReactElement; displayName: string; }; readonly Input: { (input: Omit<import("@base-ui/react").NumberFieldInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: impor… (full type in API JSON)

NumberField

Public component; use the linked family guide for complete composition and behavior.

Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.

NumberField.Root

PropertyRequiredTypeMeaning
allowOutOfRangeNoboolean | undefinedWhen true, direct text entry may be outside the min/max range without clamping, so native range underflow/overflow validation can occur. Step-based interactions (keyboard arrows, buttons, wheel, scrub) still clamp.
allowWheelScrubNoboolean | undefinedWhether to allow the user to scrub the input value with the mouse wheel while focused and hovering over the input.
classNameNostring | ((state: NumberFieldRootState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
defaultValueNonumber | undefinedThe uncontrolled value of the field when it's initially rendered. To render a controlled number field, use the value prop instead.
disabledNoboolean | undefinedWhether the component should ignore user interaction.
formNostring | undefinedIdentifies the form that owns the hidden input. Useful when the number field is rendered outside the form.
formatNoIntl.NumberFormatOptions | undefinedOptions to format the input value.
idNostring | undefinedThe id of the input element.
inputRefNoRef<HTMLInputElement> | undefinedA ref to access the hidden input element.
largeStepNonumber | undefinedThe large step value of the input element when incrementing while the shift key is held. Snaps to multiples of this value when snapOnStep is enabled.
localeNoIntl.LocalesArgumentThe locale of the input element. Defaults to the user's runtime locale.
maxNonumber | undefinedThe maximum value of the input element.
minNonumber | undefinedThe minimum value of the input element.
nameNostring | undefinedIdentifies the field when a form is submitted.
onValueChangeNo((value: number | null, eventDetails: Base.Root.ChangeEventDetails) => void) | undefinedCallback fired when the number value changes. The eventDetails.reason indicates what triggered the change: - 'input-change' for parseable typing or programmatic text updates - 'input-clear' when the field becomes empty - 'input-blur' when formatting (and clamping, if enabled) occurs on blur - 'input-paste' for paste interactions - 'keyboard' for arrow-key/Home/End stepping (typing digits uses 'input-change'/'input-clear') - 'increment-press' / 'decrement-press' for button presses on the increment and decrement controls - 'wheel' for wheel-based scrubbing - 'scrub' for scrub area drags
onValueCommittedNo((value: number | null, eventDetails: Base.Root.CommitEventDetails) => void) | undefinedCallback function that is fired when the value is committed. It runs later than onValueChange, when: - The input is blurred after typing a value. - The pointer is released after scrubbing or pressing the increment/decrement buttons. It runs simultaneously with onValueChange when interacting with the keyboard or the mouse wheel. Warning: This is a generic event not a change event.
readOnlyNoboolean | undefinedWhether the user should be unable to change the field value.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, NumberFieldRootState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
requiredNoboolean | undefinedWhether the user must enter a value before submitting a form.
smallStepNonumber | undefinedThe small step value of the input element when incrementing while the alt key is held. Snaps to multiples of this value when snapOnStep is enabled.
snapOnStepNoboolean | undefinedWhether the value should snap to the nearest step when incrementing or decrementing.
stepNonumber | "any" | undefinedAmount to increment and decrement with the buttons and arrow keys, or to scrub with pointer movement in the scrub area. To always enable step validation on form submission, specify the min prop explicitly in conjunction with this prop. Specify step="any" to always disable step validation; interactive stepping then uses a base amount of 1, while the alt and shift keys still step by smallStep and largeStep.
styleNoCSSProperties | ((state: NumberFieldRootState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
valueNonumber | null | undefinedThe raw numeric value of the field.

NumberField.Group

PropertyRequiredTypeMeaning
classNameNostring | ((state: NumberFieldGroupState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, NumberFieldGroupState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: NumberFieldGroupState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

NumberField.Input

PropertyRequiredTypeMeaning
aria-roledescriptionNostring | undefinedA user-friendly description of the input's role for assistive tech. This is a role description, not an accessible name — use Field.Label or aria-label to name the control.
classNameNostring | ((state: NumberFieldInputState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, NumberFieldInputState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: NumberFieldInputState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

NumberField.Increment

PropertyRequiredTypeMeaning
classNameNostring | ((state: NumberFieldIncrementState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, NumberFieldIncrementState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: NumberFieldIncrementState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

NumberField.Decrement

PropertyRequiredTypeMeaning
classNameNostring | ((state: NumberFieldDecrementState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, NumberFieldDecrementState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: NumberFieldDecrementState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

NumberField.ScrubArea

PropertyRequiredTypeMeaning
classNameNostring | ((state: NumberFieldScrubAreaState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
directionNo"horizontal" | "vertical" | undefinedCursor movement direction in the scrub area.
pixelSensitivityNonumber | undefinedDetermines how many pixels the cursor must move before the value changes. A higher value will make scrubbing less sensitive.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, NumberFieldScrubAreaState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: NumberFieldScrubAreaState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
teleportDistanceNonumber | undefinedIf specified, determines the distance that the cursor may move from the center of the scrub area before it will loop back around.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

NumberField.ScrubAreaCursor

PropertyRequiredTypeMeaning
classNameNostring | ((state: NumberFieldScrubAreaCursorState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, NumberFieldScrubAreaCursorState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: NumberFieldScrubAreaCursorState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"number-field", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Defaults and customization

Descriptor defaults: {"size":"md","tone":"neutral"}. Parts: root, group, input, increment, decrement, scrub-area, scrub-area-cursor. Explicit instance props take precedence over configured defaults.

Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.

State, events and accessibility

For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.

Declaration authority

Generated from packages/faye-ui/dist/controls/number-field.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.