Stepper

A macOS stepper (NSStepper): two stacked segments that increment and decrement a number. Press-and-hold auto-repeats with acceleration. The whole control is a single tab stop with role="spinbutton"; the segments themselves stay out of the tab order — keyboard users step with the arrow keys: Up/Down move by step, Home/End jump to min/max.

Copies: 1

Usage

vue
<script setup lang="ts">
import { MacStepper } from 'macvue'
import { ref } from 'vue'

const copies = ref(1)
</script>

<template>
  <MacStepper
    v-model="copies"
    :min="1"
    :max="99"
    aria-label="Copies"
  />
</template>

With a text field

The classic AppKit pairing — a text field and a stepper over one value. A dedicated number-field composite is planned; until then the pairing is a pattern.

Sizes

All five macOS control sizes; regular is the default.

Disabled

API

Props

PropTypeDefault
modelValue (v-model)number
defaultValuenumber
minnumber0
maxnumber100
stepnumber1
wrapsbooleanfalse
size'extra-large' | 'large' | 'regular' | 'small' | 'mini''regular'
disabledbooleanfalse
namestring

wraps mirrors NSStepper.valueWraps: stepping past a bound continues from the opposite one. With name set, the stepper renders a hidden input inside a <form> and participates in native form submission.

Events

EventPayload
update:modelValuenumber

Exposed

NameTypeDescription
elRef<HTMLDivElement | null>The spinbutton root element.
focus() => voidFocuses the stepper.
blur() => voidRemoves focus from the stepper.