Skip to content

Number Input

A number you can type, step or drag. Drag the label to scrub (Shift for ten steps, Alt for a tenth); hold a stepper to repeat, faster the longer you hold.

$149 once · every Pro piece

Customize

At a limit the value nudges toward the edge and springs back. Digits roll when the value changes and the field is not being edited.

Install

npx shadcn@latest add @obsyde/number-input

Needs your licence key · Get Pro

Usage

Import it from where the CLI puts it, or copy the files below by hand.

import { NumberInput } from '@/components/obsyde/ember/number-input/NumberInput';

export function Example() {
  return (
    <NumberInput defaultValue={12} min={0} max={99} />
  );
}

Files

What you get with Pro: plain React, TypeScript and CSS, with no dependencies.

  • ember/number-input/NumberInput.tsxcomponent
  • ember/number-input/number-input.cssstyles
  • ember/number-input/NumberInputDemo.tsxdemo
  • ember/shared/rolling-number.cssshared
  • ember/shared/RollingNumber.tsxshared
  • ember/shared/spring.tsshared
  • ember/shared/accent.tsshared
  • ember/forms-kit/kit.tsxshared
  • ember/shared/ember.cssshared

API

PropTypeDefault
accentAccent'ember' | 'volt' | 'arc''ember'
labelLabelstring'Amount'
valueValuenumber12
minMinnumber0
maxMaxnumber99
stepStepnumber1
unitUnitstring—
disabledDisabledbooleanfalse