Skip to content

NbNumberInput is a numeric field with built-in stepper buttons (− and +). It shares the same design language as NbTextInput and NbSelect, with default and fluid variants.

vue
<template>
  <NbNumberInput v-model="quantity" label="Quantity" :min="1" :max="10" />
</template>

<script setup lang="ts">
import { ref } from 'vue'
const quantity = ref(1)
</script>

Variants ​

Default ​

The label sits above the field. Steppers are at the trailing edge.

Fluid ​

The label and optional helper icon live inside the field at the top. Useful in dense forms.

vue
<template>
  <NbNumberInput
    v-model="count"
    variant="fluid"
    label="Editors"
    :min="1"
    :max="4"
  />
</template>

Validation states ​

Disabled ​

Props ​

PropTypeDefaultDescription
modelValuenumber | nullnullCurrent value (v-model)
labelstring-Label text
placeholderstring-Placeholder shown when value is empty
helperstring-Helper text below the field
errorstring-Error message — triggers error state
warningstring-Warning message — triggers warning state
minnumber-Minimum allowed value
maxnumber-Maximum allowed value
stepnumber1Increment/decrement amount per button press
variant'default' | 'fluid''default'Layout variant
disabledbooleanfalseDisables the field and buttons
requiredbooleanfalseMarks the field as required (adds *)
idstringautoNative input id (auto-generated if omitted)

Events ​

EventPayloadDescription
update:modelValuenumber | nullEmitted on every value change
changenumber | nullAlso emitted on every value change

Exposed ​

typescript
const inputRef = ref<InstanceType<typeof NbNumberInput>>()
inputRef.value?.focus()

Behavior ​

  • The user can type directly into the field. The value is clamped to min/max on blur or Enter.
  • The − button is dimmed when the value equals min.
  • The + button is dimmed when the value equals max.