On this page
@addTagHelper *, Webority.Ui.RazorBasic usage
Use a plain quantity field with no bounds, where the stepper moves by 1.
Bounds and step
Clamp the value to a range and set how far each stepper press moves it.
Decimal values
Use precision to round the value to the decimal places you show, such as two for money.
Unit suffix
Add a unit such as kg or % after the value, without making it part of the number.
Sizes
Use md by default, sm in dense toolbars and lg where the field needs more presence.
Validation
Mark required fields and give helper text; an error replaces the helper text when validation fails.
Disabled and read only
Disable the field when it cannot be changed yet, or make it read only when its value must still post.
Every option
Every value of every prop, one cell each.
size: all three
size="sm"
size="md" (default)
size="lg"
value: set, empty and defaultValue
value="10"value="": empty fieldvalue="10" (React: defaultValue={10}, uncontrolled start)bounds: stepper disable states
value="0" min="0" (decrease disabled)value="10" max="10" (increase disabled)empty, min/max set: both steppers stay enabledno min/max: steppers never disablestep: stepper amount
step="1" (default)step="5"precision: decimal rounding
precision="0" (default)
precision="1"
precision="2"
precision="4"
grouping: lakh and crore groups
grouping="Indian"grouping="None" (default)unit suffix
unit="kg"unit="°C"unit="/100" (longer suffix)(no unit)label
label="Quantity"required
required(default): not requiredoptional
optionaloptional with required: required wins, no (optional)(default): no (optional) suffixerror and helper text
error="Required to proceed" (helper text hidden)helper-text="Minimum 1 unit"help: info tip beside the label
help="Count the items in one order."help-label="Quantity info" (the info tip name)disabled and read only
disabledread-only(default): editableloading
loading: busy state, input blockedplaceholder
placeholder="Enter a quantity"name and id
name="qty-form" (posts with the form, no visible effect)id="qty-field" (ties the label to the input, no visible effect)className and input-class
input-class="opt-input-class" (React: className; extra classes on the input, no visible effect here)fieldClassName and class
class="opt-field-class" (React: fieldClassName; extra classes on the field wrapper, no visible effect here)onChange
onChange: React only, Razor posts the value with the form (no visible effect)ref
ref: React only, Razor has no element ref (no visible effect)stepper and optional labels
decrease-label="Less" (React: decreaseLabel; the decrease stepper name, no visible effect)increase-label="More" (React: increaseLabel; the increase stepper name, no visible effect)optional-label="(not needed)" (React: optionalLabel; text after the label when optional)Guidance
What to do, and what to avoid.
Use it when
- Any numeric input: quantities, prices, ratings, percentages.
- When min/max bounds or precision rounding are important.
- When keyboard stepping (Arrow Up/Down) would be helpful.
- When a unit suffix (kg, °C, %) adds clarity.
Reach for something else when
- Text or email. → AppInput
- Multiple choice. → AppSelect or AppRadio
- When free-text input is the only needed mode (buttons would be clutter).
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
25 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| labeldefault - | string | - | The field label |
| valuedefault - | string | - | The current number; null or unset for an empty field. |
| requireddefault false | bool | false | Marks the field as required, on the input and on the label. |
| helper-textdefault - | string | - | Help text under the field, linked to the input for screen readers. |
| errordefault - | string | - | An error message under the field. It sets the error state and aria-invalid on the input. |
Less common 20 props
| Prop | Type | Default | Description |
|---|---|---|---|
| namedefault - | string | - | The input's name, for forms. |
| iddefault - | string | - | The input's id. Unset, a generated id is used. |
| placeholderdefault - | string | - | Text shown in the empty field. |
| optionaldefault false | bool | false | Ends the label with (optional) when the field is not required. Required wins when both are set. |
| helpdefault - | string | - | Info-tip content shown beside the label. |
| help-labeldefault More information | string | More information | The accessible name of the info-tip button. |
| decrease-labeldefault Decrease | string | Decrease | Replaces the built-in English text, for other languages. |
| increase-labeldefault Increase | string | Increase | Replaces the built-in English text, for other languages. |
| optional-labeldefault (optional) | string | (optional) | Replaces the built-in English text, for other languages. |
| mindefault - | number | - | The lowest value, inclusive. The decrease stepper disables at it. |
| maxdefault - | number | - | The highest value, inclusive. The increase stepper disables at it. |
| stepdefault 1 | number | 1 | The amount one stepper click, or one ArrowUp or ArrowDown press, adds or removes. |
| precisiondefault 0 | integer | 0 | The number of decimal places the value rounds to. |
| groupingdefault none | none | indian | none | Digit grouping while the number is shown: indian writes 3,00,000 and posts the plain digits; none writes 300000. |
| unitdefault - | string | - | A unit suffix shown inside the field after the input, such as kg or %. |
| disableddefault false | bool | false | Disables the field and both steppers. |
| read-onlydefault false | bool | false | Locks the field and both steppers; the value still posts. |
| loadingdefault false | bool | false | Shows a busy state and blocks input while data loads. |
| sizedefault md | sm | md | lg | md | Control size: sm, md or lg (32, 36 or 44px). md is the default. |
| input-classdefault - | string | - | Extra classes on the input element itself |
Screen reader
3 notes- The steppers are labelled Decrease and Increase and stay out of the tab order; keyboard users step with ArrowUp and ArrowDown on the input.
- ArrowUp and ArrowDown step the value by step, within min and max.
- aria-invalid is set from error, and aria-describedby points at the error or the helper text.