// Generated by scripts/generate-showcase.mjs. Do not edit directly. page InputNumberDetail { layout = "showcase" state playground_size = ctx.url.searchParams.get("pg_size") ?? "md" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "default" state playground_class = ctx.url.searchParams.get("pg_class") ?? "" state playground_id = ctx.url.searchParams.get("pg_id") ?? "" state playground_name = ctx.url.searchParams.get("pg_name") ?? "default-quantity" state playground_value = ctx.url.searchParams.get("pg_value") ?? "1" state playground_min = ctx.url.searchParams.get("pg_min") ?? "0" state playground_max = ctx.url.searchParams.get("pg_max") ?? "99" state playground_step = ctx.url.searchParams.get("pg_step") ?? "1" state playground_precision = ctx.url.searchParams.get("pg_precision") ?? "auto" state playground_label = ctx.url.searchParams.get("pg_label") ?? "" state playground_description = ctx.url.searchParams.get("pg_description") ?? "" state playground_helpText = ctx.url.searchParams.get("pg_helpText") ?? "" state playground_error = ctx.url.searchParams.get("pg_error") ?? "" state playground_invalid = ctx.url.searchParams.get("pg_invalid") ?? "false" state playground_prefix = ctx.url.searchParams.get("pg_prefix") ?? "" state playground_suffix = ctx.url.searchParams.get("pg_suffix") ?? "" state playground_placeholder = ctx.url.searchParams.get("pg_placeholder") ?? "" state playground_autocomplete = ctx.url.searchParams.get("pg_autocomplete") ?? "off" state playground_inputMode = ctx.url.searchParams.get("pg_inputMode") ?? "decimal" state playground_ariaLabel = ctx.url.searchParams.get("pg_ariaLabel") ?? "" state playground_required = ctx.url.searchParams.get("pg_required") ?? "false" state playground_disabled = ctx.url.searchParams.get("pg_disabled") ?? "false" state playground_inputDisabled = ctx.url.searchParams.get("pg_inputDisabled") ?? "false" state playground_buttonsDisabled = ctx.url.searchParams.get("pg_buttonsDisabled") ?? "false" state playground_readonly = ctx.url.searchParams.get("pg_readonly") ?? "false" state playground_allowInput = ctx.url.searchParams.get("pg_allowInput") ?? "true" state playground_keyboard = ctx.url.searchParams.get("pg_keyboard") ?? "true" state playground_wheel = ctx.url.searchParams.get("pg_wheel") ?? "false" state playground_clamp = ctx.url.searchParams.get("pg_clamp") ?? "true" state playground_fullWidth = ctx.url.searchParams.get("pg_fullWidth") ?? "false" state playground_showButtons = ctx.url.searchParams.get("pg_showButtons") ?? "true" state playground_showValidationMessage = ctx.url.searchParams.get("pg_showValidationMessage") ?? "true" state playground_decrementLabel = ctx.url.searchParams.get("pg_decrementLabel") ?? "Decrease value" state playground_incrementLabel = ctx.url.searchParams.get("pg_incrementLabel") ?? "Increase value" state playground_controlsLabel = ctx.url.searchParams.get("pg_controlsLabel") ?? "Quantity controls" state playground_requiredMessage = ctx.url.searchParams.get("pg_requiredMessage") ?? "A value is required." state playground_minMessage = ctx.url.searchParams.get("pg_minMessage") ?? "Value is below the minimum." state playground_maxMessage = ctx.url.searchParams.get("pg_maxMessage") ?? "Value is above the maximum." seo { title = "Input Number" description = "Theme-aware, responsive input number component." } view {
Advanced Forms component

Input Number

Theme-aware, responsive input number component.

40 props0 slots4 eventsTheme readyResponsive
Interactive playground

Configure Input Number

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<InputNumber
  size="md"
  name="default-quantity"
  value="1"
  min="0"
  max="99"
/>
Component props40 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Basic usage

Default controls

Use standard decrement and increment buttons alongside a numeric input field.

01
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="default-quantity"
  value="1"
  min="0"
  max="99"
/>
Basic usage

Labeled input style

Add supporting label text and rounded controls for a more form-like number input.

02
Live preview
Component usage.wrn
<InputNumber
  size="md"
  variant="labeled"
  name="labeled-quantity"
  value="1"
  min="1"
  max="25"
  label="Select quantity"
/>
Layout

Vertical buttons

Stack the increment and decrement buttons vertically beside the field.

03
Live preview
Component usage.wrn
<InputNumber
  size="md"
  variant="vertical"
  name="vertical-quantity"
  value="1"
  min="0"
  max="20"
  label="Select quantity"
/>
Layout

Horizontal buttons

Place the increment and decrement buttons on opposite sides of the value.

04
Live preview
Component usage.wrn
<InputNumber
  size="md"
  variant="horizontal"
  name="horizontal-quantity"
  value="1"
  min="0"
  max="20"
/>
Sizing

Compact size

Use a smaller compact control when the available space is limited.

05
Live preview
Component usage.wrn
<InputNumber
  size="sm"
  variant="compact"
  name="compact-quantity"
  min="0"
  max="10"
/>
Commerce

Seat quantity selector

Pair the control with pricing information for seat counts or plan add-ons.

06
Live preview
Component usage.wrn
<InputNumber
  size="md"
  variant="seat"
  name="additional-seats"
  min="0"
  max="50"
  label="Additional seats"
  description="$39 monthly"
/>
States

Disabled input

Disable manual entry while keeping supported quantity controls available.

07
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="disabled-input"
  value="10"
  inputDisabled="true"
/>
States

Disabled buttons

Disable increment and decrement controls while leaving the current value visible.

08
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="disabled-buttons"
  value="10"
  buttonsDisabled="true"
/>
Behaviour

Custom step size

Set a custom step so every button press changes the value by two.

09
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="custom-step"
  min="0"
  max="20"
  step="2"
/>
Limits

Negative values

Use the min option to permit controlled negative values.

010
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="negative-values"
  value="-10"
  min="-100"
  max="100"
/>
Limits

Maximum limit

Set an upper limit and disable incrementing when that limit is reached.

011
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="maximum-limit"
  value="10"
  min="0"
  max="10"
/>
Validation

Validation states

Communicate whether the current numerical value is valid.

012
Live preview
Component usage.wrn
<InputNumber
  size="md"
  name="invalid-quantity"
  value="10"
  min="0"
  max="5"
  error="Out of limit"
/>
Component events

Events

Public events declared by this component. Custom events bubble from the component root and expose state through event.detail.

@inputFires immediately as the component value changes.
@changeFires when the component value or selection changes.
@incrementFires when the component emits the increment event.
@decrementFires when the component emits the decrement event.
Event listener.js
const component = document.querySelector('[data-wrn-events]')

component.addEventListener('input', (event) => {
  console.log(event.detail)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
sizestring"default"No
colorstring"primary"No
variantstring"default"No
classstring""No
idstring""No
namestring"quantity"No
valuenumber0No
minstring""No
maxstring""No
stepnumber1No
precisionstring"auto"No
labelstring""No
descriptionstring""No
helpTextstring""No
errorstring""No
invalidbooleanfalseNo
prefixstring""No
suffixstring""No
placeholderstring""No
autocompletestring"off"No
inputModestring"decimal"No
ariaLabelstring""No
requiredbooleanfalseNo
disabledbooleanfalseNo
inputDisabledbooleanfalseNo
buttonsDisabledbooleanfalseNo
readonlybooleanfalseNo
allowInputbooleantrueNo
keyboardbooleantrueNo
wheelbooleanfalseNo
clampbooleantrueNo
fullWidthbooleanfalseNo
showButtonsbooleantrueNo
showValidationMessagebooleantrueNo
decrementLabelstring"Decrease value"No
incrementLabelstring"Increase value"No
controlsLabelstring"Quantity controls"No
requiredMessagestring"A value is required."No
minMessagestring"Value is below the minimum."No
maxMessagestring"Value is above the maximum."No
} }