AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Entry

InputNumber

Enter a number with steppers, min/max and precision — quantities, limits, durations — rendered through the shared InputNumber.

Examples

API

PropTypeDefaultNotes
valuenumberControlled numeric value
size'small' | 'middle' | 'large''middle'Field height: small 24 · default 32 · large 40
status'error' | 'warning'Validation state — coloured border/glow
minnumber-InfinityLower bound
maxnumberInfinityUpper bound
stepnumber1Increment for steppers / arrow keys
precisionnumberFixed decimal places
controlsbooleantrueShow the up/down steppers
disabledbooleanfalseNon-interactive, greyed field
readOnlybooleanfalseValue visible but not editable
prefixReactNodeInline leading affix (e.g. $)
addonBeforeReactNodeAttached leading label
addonAfterReactNodeAttached trailing label (e.g. unit)
onChange(value) => voidFires with the new number

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/input-number-theme';   // registers <input-number>

Agent feed for this component (absolute, fetchable anywhere): input-number.agent.json · input-number.md · input-number.llms.txt

When to use

When to use
  • InputNumber — a bounded numeric quantity — a limit, a count, a duration where steppers help
  • Slider — an approximate value across a known range where the exact number matters less
  • Input type=number — a free number with no bounds or steppers — but prefer InputNumber for validity
Set min/max to the real limits so the field constrains instead of validating after the fact. Pre-fill a sensible default rather than empty; use precision for currency/percentages.
Surfaces
editor dashboard settings

Spec

Field height 32 (md) · radius 8 · 1px #E3E3E3 border · Sizes small 24 · default 32 · large 40 · font 14 · Hover #D3B4FF (purple-30) border · Focus brand #6A1EBB border · Status error #F5222D · warning border/glow · Steppers up/down on hover; keyboard ↑ ↓; toggle via controls · Placeholder #8A8A8A