docs/components/input/NumberInput

NumberInput

Numeric input with increment/decrement controls.

import { NumberInput } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#More Examples

With Label

<NumberInput label="Quantity" defaultValue={1} />

With Range

<NumberInput label="Percentage" defaultValue={50} min={0} max={100} step={10} />

#Props

PropTypeDefaultDescription
valuenumberControlled value.
defaultValuenumberUncontrolled initial value.
onChange(value: number) => voidCallback when value changes.
minnumber-InfinityMinimum allowed value.
maxnumberInfinityMaximum allowed value.
stepnumber1Step increment for buttons and keyboard.
precisionnumberDecimal places (auto-detected from step if not provided).
labelstringLabel text displayed above the input.
disabledbooleanfalseDisable interaction.
size'sm' | 'md' | 'lg'Input size preset.
classstringAdditional CSS classes.
placeholderstringPlaceholder text for the input.
unstyledbooleanfalseRemove all default styling classes.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-bg-active
  • --sk-bg-disabled
  • --sk-bg-hover
  • --sk-bg-secondary
  • --sk-bg-tertiary
  • --sk-border
  • --sk-font-size-lg
  • --sk-font-size-md
  • --sk-font-size-sm
  • --sk-number-input-bg
  • --sk-number-input-border
  • --sk-number-input-btn-bg
  • --sk-number-input-focus-ring
  • --sk-number-input-width
  • --sk-radius-md
  • --sk-space-md
  • --sk-space-sm
  • --sk-space-xs
  • --sk-text-primary
  • --sk-text-secondary
  • --sk-text-tertiary