@hanzo/ui

Number Field

import { NumberField, parseNumber } from '@hanzo/ui'

No examples yet.

Types

export type NumberFieldProps = Omit<InputProps, 'value' | 'defaultValue' | 'onChangeText' | 'type' | 'secureTextEntry' | 'reveal'> & {
  value?: number | null
  defaultValue?: number | null
  /** Every number the text reads as while typing, the clamped one on blur, and each step. */
  onValueChange?: (value: number | null) => void
  min?: number
  max?: number
  /** ArrowUp/ArrowDown and the buttons. */
  step?: number
  /** With Alt held. */
  smallStep?: number
  /** With Shift held. */
  largeStep?: number
  /** How the number is written when the field is not being edited (Intl.NumberFormat). */
  format?: Intl.NumberFormatOptions
  /** The locale it is written and read in; the reader's by default. */
  locale?: string
  /** Keep a typed number outside min/max instead of clamping it on blur. */
  allowOutOfRange?: boolean
  readOnly?: boolean
  required?: boolean
  /** Decrement and increment buttons beside the field. */
  buttons?: boolean
  decrementLabel?: string
  incrementLabel?: string
}

Exports

NumberFieldparseNumbertype NumberFieldProps