XiodUI
HomeDocs
OverviewComponentsThemes & ColorsChangelog
⌘ K

Components

  • Accordion
  • Agent Steps
    New
  • Alert
  • Alert Dialog
  • Aspect Ratio
    New
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
    Updated
  • Button Group
    New
  • Button Split
    New
  • Calendar
    New
  • Card
  • Carousel
    New
  • Checkbox
  • Circular Progress
    New
  • Collapsible
  • Color Picker
    New
  • Combobox
  • Command
  • Context Menu
    New
  • Copy To Clipboard
    New
  • Corner Badge
    New
  • Dashboard Grid
    New
  • Date Picker
    New
  • Dialog
  • Dot Matrix
    New
  • Draggable
    New
  • Drawer
    New
  • Empty
  • Field
  • Fieldset
  • File Upload
    New
  • Form
  • Frame
  • Gauge
    New
  • Grid
    New
  • Group
  • Input
  • Input Group
  • Input OTP
    New
  • Input Payment
    New
  • Input Phone
    New
  • Input Sensitive
    New
  • Kbd
  • Kinetic Click
    New
  • Label
  • List Box
    New
  • Loader
  • Marker
    New
  • Menu
  • Menubar
  • Message
    New
  • Meter
  • Morphic Toast
    New
  • Navigation Menu
  • Number Field
  • Option Picker
    New
  • Orb
    New
  • Pagination
  • Popover
  • Preview Card
  • Progress
  • Radio
  • Resizable
    New
  • Ruler Picker
    New
  • Scroll Area
  • Scroll Bar
    New
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
    Updated
  • Sortable
    New
  • Switch
    Updated
  • Table
  • Tabs
  • Text
    New
  • Textarea
  • Timeline
    New
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
    Updated
  • Waveform
    New
  • Wheel Picker
    New
/
/

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Number Field

Previous: Navigation MenuNext: Option Picker

A numeric input field.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import {2  NumberField,3  NumberFieldDecrement,4  NumberFieldGroup,5  NumberFieldIncrement,6  NumberFieldInput,7  NumberFieldScrubArea8} from "xiod-ui/number-field";

Anatomy

1<NumberField>2  <NumberFieldInput />3  <NumberFieldGroup>4    <NumberFieldDecrement />5    <NumberFieldIncrement />6    <NumberFieldScrubArea />7  </NumberFieldGroup>8</NumberField>

API Reference

Detailed documentation of properties and options.

NumberField

PropTypeDefaultDescription
id
string
|undefined
-The id of the input element.
min
number
|undefined
-The minimum value of the input element.
max
number
|undefined
-The maximum value of the input element.
allowOutOfRange
boolean
|undefined
falseWhen 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.
smallStep
number
|undefined
0.1The 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.
step
number
|"any"
|undefined
1Amount 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`.
largeStep
number
|undefined
10The 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.
required
boolean
|undefined
falseWhether the user must enter a value before submitting a form.
disabled
boolean
|undefined
falseWhether the component should ignore user interaction.
readOnly
boolean
|undefined
falseWhether the user should be unable to change the field value.
name
string
|undefined
-Identifies the field when a form is submitted.
form
string
|undefined
-Identifies the form that owns the hidden input. Useful when the number field is rendered outside the form.
value
number
|null
|undefined
-The raw numeric value of the field.
defaultValue
number
|undefined
-The uncontrolled value of the field when it's initially rendered. To render a controlled number field, use the `value` prop instead.
allowWheelScrub
boolean
|undefined
falseWhether to allow the user to scrub the input value with the mouse wheel while focused and hovering over the input.
snapOnStep
boolean
|undefined
falseWhether the value should snap to the nearest step when incrementing or decrementing.
format
NumberFormatOptions
|undefined
-Options to format the input value.
onValueChange
((value: number
|null, eventDetails: NumberFieldRootChangeEventDetails) => void)
|undefined
-Callback 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
onValueCommitted
((value: number
|null, eventDetails: NumberFieldRootCommitEventDetails) => void)
|undefined
-Callback 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.
locale
LocalesArgument
-The locale of the input element. Defaults to the user's runtime locale.
inputRef
Ref<HTMLInputElement>
|undefined
-A ref to access the hidden input element.
style
CSSProperties
|((state: NumberFieldRootState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.
className
string
|((state: NumberFieldRootState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, NumberFieldRootState>
|undefined
-Allows 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.
size
"default"
|"sm"
|"lg"
|undefined
default

NumberFieldDecrement

PropTypeDefaultDescription
nativeButton
boolean
|undefined
trueWhether 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>`).
className
string
|((state: NumberFieldDecrementState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, NumberFieldDecrementState>
|undefined
-Allows 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.
style
CSSProperties
|((state: NumberFieldDecrementState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.

NumberFieldGroup

PropTypeDefaultDescription
className
string
|((state: NumberFieldGroupState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, NumberFieldGroupState>
|undefined
-Allows 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.
style
CSSProperties
|((state: NumberFieldGroupState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.

NumberFieldIncrement

PropTypeDefaultDescription
nativeButton
boolean
|undefined
trueWhether 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>`).
className
string
|((state: NumberFieldIncrementState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, NumberFieldIncrementState>
|undefined
-Allows 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.
style
CSSProperties
|((state: NumberFieldIncrementState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.

NumberFieldInput

PropTypeDefaultDescription
aria-roledescription
string
|undefined
'Number field'A 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.
className
string
|((state: NumberFieldInputState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, NumberFieldInputState>
|undefined
-Allows 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.
style
CSSProperties
|((state: NumberFieldInputState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.

NumberFieldScrubArea

PropTypeDefaultDescription
direction
"horizontal"
|"vertical"
|undefined
'horizontal'Cursor movement direction in the scrub area.
pixelSensitivity
number
|undefined
2Determines how many pixels the cursor must move before the value changes. A higher value will make scrubbing less sensitive.
teleportDistance
number
|undefined
-If specified, determines the distance that the cursor may move from the center of the scrub area before it will loop back around.
className
string
|((state: NumberFieldScrubAreaState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, NumberFieldScrubAreaState>
|undefined
-Allows 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.
style
CSSProperties
|((state: NumberFieldScrubAreaState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.
labelReq
string
-
Navigation MenuOption Picker