Skip to main content

Number input

Ask AIView as Markdown
Copy a prompt to ask an AI assistant about this page.

Number input - Code

Basic​

Disabled​

Label​

Readonly​

Stepper buttons​

Validation​

Slots​

API for ix-number-input​

Properties​

Description

If true, the valueChange event will return null instead of 0 for an empty input state.

This property will be removed in 5.0.0 and this behaviour will be default.

Attribute
allow-empty-value-change
Type
boolean
Default
false
Description

The allowed characters pattern for the input field

Attribute
allowed-characters-pattern
Type
string | undefined
Description

Disables the input field

Attribute
disabled
Type
boolean
Default
false
Description

The helper text for the input field

Attribute
helper-text
Type
string | undefined
Description

The info text for the input field

Attribute
info-text
Type
string | undefined
Description

The error text for the input field

Attribute
invalid-text
Type
string | undefined
Description

The label for the input field

Attribute
label
Type
string | undefined
Description

The maximum value for the input field

Attribute
max
Type
number | string | undefined
Description

The minimum value for the input field

Attribute
min
Type
number | string | undefined
Description

name of the input element

Attribute
name
Type
string | undefined
Description

The pattern for the input field

Attribute
pattern
Type
string | undefined
Description

placeholder of the input element

Attribute
placeholder
Type
string | undefined
Description

Indicates if the field is read-only

Attribute
readonly
Type
boolean
Default
false
Description

Indicates if the field is required. When required, empty values (undefined) are not accepted.

Attribute
required
Type
boolean
Default
false
Description

Indicates if the stepper buttons should be shown

Attribute
show-stepper-buttons
Type
boolean | undefined
Description

Indicates if the text should be shown as a tooltip

Attribute
show-text-as-tooltip
Type
boolean | undefined
Description

Step value to increment or decrement the input value. Default step value is 1.

Attribute
step
Type
number | string | undefined
Default
1
Description

If false, pressing Enter will submit the form (if inside a form).

Set to true to suppress submit on Enter.

Attribute
suppress-submit-on-enter
Type
boolean
Default
false
Description

Text alignment within the number input. 'start' aligns the text to the start of the input, 'end' aligns the text to the end of the input.

Attribute
text-alignment
Type
"end" | "start"
Default
'end'
Description

The valid text for the input field

Attribute
valid-text
Type
string | undefined
Description

The value of the input field. Supports numeric values, scientific notation (1E6, 1E-6), or undefined for empty.

Attribute
value
Type
number | undefined
Default
0
Description

The warning text for the input field

Attribute
warning-text
Type
string | undefined

Methods​

Events​

Description

Event emitted when the input field loses focus

Event
ixBlur
Detail
void
Description

Event emitted when the input field loses focus and the value has changed

Event
ixChange
Detail
number
Description

Event emitted when the validity state of the input field changes

Event
validityStateChange
Detail
ValidityState
Description

Event emitted when the value of the input field changes

Event
valueChange
Detail
number

Slot​

Description

Element will be displayed at the end of the input

Description

Element will be displayed at the start of the input