Skip to content

Number Input

Numeric field with increment and decrement controls.

Installation

bun add @xerobi/ui
import { NumberInput } from "@xerobi/ui/number-input"

This component is client-side. In Astro, hydrate it with a client directive.

Examples

Default

import { NumberInput } from "@xerobi/ui/number-input"

export function NumberInputDefault() {
  return <NumberInput min={0} max={10} />
}

API reference

NumberInput

PropTypeDescription
minnumber
maxnumber
errorboolean
disabledboolean
valuenumber
hideDividerboolean
hideButtonsboolean
disableInputboolean
helperTextstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>
captionTextstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>
slotProps{ wrapper?: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> | undefined; input?: Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElemen...
onChange(event: EventHandler, value: number) => void

Search documentation

Search pages, components and blocks.