Default controls
Use standard decrement and increment buttons alongside a numeric input field.
<InputNumber
size="md"
name="default-quantity"
value="1"
min="0"
max="99"
step="1"
/>
// 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_label = ctx.url.searchParams.get("pg_label") ?? "Input Number"
state playground_name = ctx.url.searchParams.get("pg_name") ?? "default-quantity"
state playground_value = ctx.url.searchParams.get("pg_value") ?? "1"
state playground_placeholder = ctx.url.searchParams.get("pg_placeholder") ?? ""
state playground_type = ctx.url.searchParams.get("pg_type") ?? "number"
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_disabled = ctx.url.searchParams.get("pg_disabled") ?? "false"
state playground_required = ctx.url.searchParams.get("pg_required") ?? "false"
state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
seo {
title = "Input Number"
description = "Theme-aware, responsive input number component."
}
view {
Theme-aware, responsive input number component. Change any prop and inspect the server-rendered component immediately.Input Number
Configure Input Number
<InputNumber
size="md"
name="default-quantity"
value="1"
min="0"
max="99"
step="1"
/>
Compare configurations and resize the browser to check responsive behavior.
Use standard decrement and increment buttons alongside a numeric input field.
<InputNumber
size="md"
name="default-quantity"
value="1"
min="0"
max="99"
step="1"
/>
Add supporting label text and rounded controls for a more form-like number input.
<InputNumber
size="md"
label="Select quantity"
name="labeled-quantity"
value="1"
min="1"
max="25"
step="1"
/>
Stack the increment and decrement buttons vertically beside the field.
<InputNumber
size="md"
label="Select quantity"
name="vertical-quantity"
value="1"
min="0"
max="20"
/>
Place the increment and decrement buttons on opposite sides of the value.
<InputNumber
size="md"
name="horizontal-quantity"
value="1"
min="0"
max="20"
/>
Use a smaller compact control when the available space is limited.
<InputNumber
size="sm"
name="compact-quantity"
value="0"
min="0"
max="10"
/>
Pair the control with pricing information for seat counts or plan add-ons.
<InputNumber
size="md"
label="Additional seats"
name="additional-seats"
value="0"
min="0"
max="50"
/>
Disable manual entry while keeping supported quantity controls available.
<InputNumber
size="md"
name="disabled-input"
value="10"
/>
Disable increment and decrement controls while leaving the current value visible.
<InputNumber
size="md"
name="disabled-buttons"
value="10"
/>
Set a custom step so every button press changes the value by two.
<InputNumber
size="md"
name="custom-step"
value="0"
min="0"
max="20"
step="2"
/>
Use the min option to permit controlled negative values.
<InputNumber
size="md"
name="negative-values"
value="-10"
min="-100"
max="100"
/>
Set an upper limit and disable incrementing when that limit is reached.
<InputNumber
size="md"
name="maximum-limit"
value="10"
min="0"
max="10"
/>
Communicate whether the current numerical value is valid.
<InputNumber
size="md"
name="invalid-quantity"
value="10"
min="0"
max="5"
/>
All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|---|---|---|
size | string | "default" | No |
color | string | "primary" | No |
label | string | "Input Number" | No |
name | string | "" | No |
value | string | "" | No |
placeholder | string | "" | No |
type | string | "number" | No |
min | string | "" | No |
max | string | "" | No |
step | string | "" | No |
disabled | boolean | false | No |
required | boolean | false | No |
class | string | "" | No |