BridgeBeta
  • Brand
  • Digital Assets
    Foundations
    Icons
    Components
    Templates
  • Resources
    Design Tokens
    How-tos
    Best Practices
    Libraries
    Accessibility
    Products List
  • Support
    • Overview
    • Actions
      • Overview
      • Button
      • ContextMenu
      • Link
    • Controls
      • Overview
      • Checkbox
      • Tag
      • Toggle
    • Forms
      • Overview
      • DatePicker
      • FileUploader
      • Input
      • NumberInput
      • RadioButton
      • Search
      • Select
      • Slider
      • TextArea
      • TextInput
    • Hooks
      • useIsomorphicLayoutEffect
      • useMediaQuery
      • useSettings
    • Navigation
      • Overview
      • AnchorNavigation
      • BannerNavigation
      • Breadcrumb
      • Footer
      • InfoBar
      • MainNavigation
      • SecondaryNavigation
      • StepNavigation
      • SubNavigation
    • Overlay
      • Overview
      • Credits
      • Modal
      • ModalWrapper
      • Notification
      • Tooltip
    • Structure
      • Overview
      • Accordion
      • AuthLayout
      • Avatar
      • Callout
      • Card
      • ContentSwitcher
      • Empty
      • Hero
      • InlineLoading
      • Item
      • List
      • Loading
      • mdxComponents
      • Module
      • Pagination
      • ReadMore
      • Story
      • Table
      • Tabs
      • Text
      • Unit
      • User
      • WFPCoreProvider
      • Wrapper
Components
Forms
NumberInput

NumberInput

  • Design
  • Code
  • Props

Import statement

import { NumberInput } from "@wfp/react"

The NumberInput component allows users to input numeric values. It includes controls for incrementally increasing or decreasing the value.

Usage

To use the NumberInput component, you should import it and render it within a parent component:

import { NumberInput } from "@wfp/react";
<NumberInput
id="number-input"
min={0}
max={100}
step={5}
onChange={(evt, value, direction) => {
console.log(`Value: ${value}, Direction: ${direction}`);
}}
/>

This will render a NumberInput component with a minimum value of 0, a maximum value of 100, and an increment/decrement step of 5.

Notes

  • The component uses the React.forwardRef method, allowing refs to be forwarded to it.
  • The component uses utility functions capMin and capMax to ensure the value remains within the specified min and max bounds.

Related

  • TextInput
  • Input

On this page

  • Usage
  • Notes
  • Related

References

  • Storybook
Storybook
Figma library
Contact us
2025 © World Food Programme