Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

NumberField

Numeric entry with increment buttons, bounds, locale formatting and scrubbing.

CoreAdvanced Inputs@gaudi/design-system/core/NumberFieldView in StorybookSource

Installation

pnpm add github:ahmadassaf/design-system

Import from @gaudi/design-system. Load @gaudi/design-system/global.css once and add transpilePackages: ['@gaudi/design-system'] in Next.js.

import { NumberField } from '@gaudi/design-system/core/NumberField';

Copy an example into your project with the shadcn CLI: npx shadcn@latest add https://design.gaudi.site/r/number-field-button-layouts.json.

Usage

import { NumberField, NumberFieldGroup, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement } from '@gaudi/design-system/core/NumberField';
<NumberField value={quantity} onValueChange={setQuantity} min={1}> <NumberFieldGroup><NumberFieldDecrement /><NumberFieldInput aria-label='Quantity' /><NumberFieldIncrement /></NumberFieldGroup></NumberField>

Examples

Button layouts

Storybook

Form validation

Storybook

API

9 props

Accessibility

Compose the input and increment/decrement parts inside NumberField. Base UI preserves spinbutton semantics and keyboard adjustment.

Notes

  • The text editor inherits InputConfigProvider. Set caretMode="native" or caretMode="smooth" on NumberFieldInput to override the provider. Numeric parsing, formatting, bounds and stepping stay with NumberField.