Skip to content
angulux
@anguless/angulux/inputnumber

inputnumber

1 declarations4 demos
import
import { InputNumberModule } from '@anguless/angulux/inputnumber';

Basic

InputNumber binds to a number and formats it for the locale.

<agl-inputNumber [(ngModel)]="value" inputId="qty" />

Buttons

showButtons adds spinners, stacked by default and horizontal on request.

<agl-inputNumber [(ngModel)]="stacked" [showButtons]="true" [min]="0" [max]="100" /><agl-inputNumber [(ngModel)]="horizontal" [showButtons]="true" buttonLayout="horizontal" [min]="0" [max]="100" incrementButtonIcon="pi pi-plus" decrementButtonIcon="pi pi-minus" />

Currency

Currency mode formats the value for a currency and a locale.

<agl-inputNumber [(ngModel)]="usd" mode="currency" currency="USD" locale="en-US" /><agl-inputNumber [(ngModel)]="vnd" mode="currency" currency="VND" locale="vi-VN" />

Decimals and affixes

Fraction digits, prefixes and suffixes are all properties rather than formatting done by hand.

<agl-inputNumber [(ngModel)]="value" [minFractionDigits]="2" [maxFractionDigits]="5" /><agl-inputNumber [(ngModel)]="percent" suffix="%" [min]="0" [max]="100" />

API

Generated from the committed corpus, which check:corpus holds to the built library.

InputNumber

componentagl-inputNumber, agl-inputnumber, agl-input-number

InputNumber is an input component to provide numerical input.

InputTypeDefaultDescription
showButtonsbooleannot documentedDisplays spinner buttons.
formatbooleannot documentedWhether to format the value.
buttonLayoutstringnot documentedLayout of the buttons, valid values are "stacked" (default), "horizontal" and "vertical".
inputIdstring | undefinednot documentedIdentifier of the focus input to match a label defined for the component.
styleClass
deprecated — since v20.0.0, use `class` instead.
string | undefinednot documentedStyle class of the component.
placeholderstring | undefinednot documentedAdvisory information to display on input.
tabindexnumber | undefinednot documentedSpecifies tab order of the element.
titlestring | undefinednot documentedTitle text of the input text.
ariaLabelledBystring | undefinednot documentedSpecifies one or more IDs in the DOM that labels the input field.
ariaDescribedBystring | undefinednot documentedSpecifies one or more IDs in the DOM that describes the input field.
ariaLabelstring | undefinednot documentedUsed to define a string that labels the input element.
ariaRequiredboolean | undefinednot documentedUsed to indicate that user input is required on an element before a form can be submitted.
autocompletestring | undefinednot documentedUsed to define a string that autocomplete attribute the current element.
incrementButtonClassstring | undefinednot documentedStyle class of the increment button.
decrementButtonClassstring | undefinednot documentedStyle class of the decrement button.
incrementButtonIconstring | undefinednot documentedStyle class of the increment button.
decrementButtonIconstring | undefinednot documentedStyle class of the decrement button.
readonlyboolean | undefinednot documentedWhen present, it specifies that an input field is read-only.
allowEmptybooleannot documentedDetermines whether the input field is empty.
localestring | undefinednot documentedLocale to be used in formatting.
localeMatcheranynot documentedThe locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". See Locale Negotiation for details.
modestring | anynot documentedDefines the behavior of the component, valid values are "decimal" and "currency".
currencystring | undefinednot documentedThe currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB. There is no default value; if the style is "currency", the currency property must be provided.
currencyDisplaystring | undefined | anynot documentedHow to display the currency in currency formatting. Possible values are "symbol" to use a localized currency symbol such as €, ü"code" to use the ISO currency code, "name" to use a localized currency name such as "dollar"; the default is "symbol".
useGroupingbooleannot documentedWhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.
minFractionDigitsnumber | undefinednot documentedThe minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the ISO 4217 currency code list (2 if the list doesn't provide that information).
maxFractionDigitsnumber | undefinednot documentedThe maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the ISO 4217 currency code list (2 if the list doesn't provide that information).
prefixstring | undefinednot documentedText to display before the value.
suffixstring | undefinednot documentedText to display after the value.
inputStyleanynot documentedInline style of the input field.
inputStyleClassstring | undefinednot documentedStyle class of the input field.
showClearbooleannot documentedWhen enabled, a clear icon is displayed to clear the value.
autofocusboolean | undefinednot documentedWhen present, it specifies that the component should automatically get focus on load.
OutputTypeDescription
onInputEventEmitter<InputNumberInputEvent>Callback to invoke on input.
onFocusEventEmitter<Event>Callback to invoke when the component receives focus.
onBlurEventEmitter<Event>Callback to invoke when the component loses focus.
onKeyDownEventEmitter<KeyboardEvent>Callback to invoke on input key press.
onClearEventEmitter<void>Callback to invoke when clear token is clicked.
Template slotDescription
<ng-template #clearicon>Custom clear icon template.
<ng-template #incrementbuttonicon>Custom increment button icon template.
<ng-template #decrementbuttonicon>Custom decrement button icon template.

Inherited from BaseInput

inherited
InputTypeDefaultDescription
fluid false Spans 100% width of the container when enabled.
variant'filled' | 'outlined' | undefined 'outlined' Specifies the input variant of the component.
size'large' | 'small' | undefined undefined Specifies the size of the component.
inputSizenumber | null | undefined undefined Specifies the visible width of the input element in characters.
patternstring | null | undefined undefined Specifies the value must match the pattern. A list of regular expressions — what Signal Forms binds through `[formField]` — is ignored, because the form validates those itself.
minnumber | null | undefined undefined The value must be greater than or equal to the value. A numeric string is read as a number; anything else that is not a finite number, such as the `Date` limit of a date field, is ignored.
maxnumber | null | undefined undefined The value must be less than or equal to the value. A numeric string is read as a number; anything else that is not a finite number, such as the `Date` limit of a date field, is ignored.
stepnumber | null | undefined undefined Unless the step is set to the any literal, the value must be min + an integral multiple of the step.
minlengthnumber | null | undefined undefined The number of characters (code points) must not be less than the value of the attribute, if non-empty.
maxlengthnumber | null | undefined undefined The number of characters (code points) must not exceed the value of the attribute.

Inherited from BaseEditableHolder

inherited
InputTypeDefaultDescription
required false There must be a value (if set). Left unbound, a control bound through `formControlName`, `[formControl]` or `ngModel` is required when that control carries `Validators.required` or `Validators.requiredTrue`.
invalid false When present, it specifies that the component should have invalid state style. Left unbound, a control bound through `formControlName`, `[formControl]` or `ngModel` shows the state of that control once it is touched or dirty.
touchedboolean | undefined undefined Whether the user has visited the control. Once this or `dirty` is set, the invalid state style waits for interaction: it appears when the control is touched or dirty. Signal Forms' `[formField]` sets both, so an untouched required field is not shown as invalid. Leave both unset and `invalid` alone decides.
dirtyboolean | undefined undefined Whether the user has changed the value. See `touched`.
disabled false When present, it specifies that the component should have disabled state style.
namestring | undefined undefined When present, it specifies that the name of the input.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.