Skip to content

InputNumber ​

Numeric field with keyboard stepping and embedded spin buttons. Height 28 / 34 / 40, radius --gk-radius-md, and a soft focus ring.

gk-input still uses --gk-radius-sm. Unifying that radius is a follow-up so form rows do not mix corners.

Demos ​

Basic

Bind value and listen for change or update:value with e.detail.value. input streams while typing. Commit happens on blur, Enter, a spin button, or an arrow key.
NT$

Value: 1280

Min, max, step

The button at the limit is disabled. The field stays editable.
件

Precision

When precision is omitted, decimal places come from step (0.5 → 1).
kg

Sizes

Status

Disabled and readonly

Readonly omits the spin buttons. Disabled fades the whole field.
件

Buttons on both sides

button-placement="both" puts − and + outside the field. The default right stacks chevrons at the end. To turn buttons off in Vue, bind .showButton="false" — a present boolean attribute is always true.

API ​

Properties ​

NameTypeDefaultNotes
valuenumber | nullnullEmpty when null
min / maxnumber—Clamp on commit and on step
stepnumber1Arrow and button increment
precisionnumberfrom stepDecimal places
sizesm | md | lgmd28 / 34 / 40
statussuccess | warning | error—
disabled / readonlybooleanfalseReadonly hides steppers
show-buttonbooleantrue
button-placementright | bothright
placeholder / namestring—name participates in a native form

Events ​

NameDetail
input{ value } while typing or stepping. Native input does not cross the shadow root
change, update:value{ value } on commit
focus, blur

Slots and parts ​

Slots: prefix, suffix. Parts: base, input, prefix, suffix, controls, increment, decrement.

The input is role="spinbutton". Buttons are labelled Increase / Decrease, or 增加 / 減少 when the language is Chinese. Holding a button to repeat is a follow-up.