| Name |
Type |
Default value |
Description |
|---|
| Accent |
BitColor? |
null |
The general color of the number field, used for its focus indicator and for the icon, prefix and suffix while the field is focused (Primary by default). An explicit value wins over the --bit-NumberField-* variables it paints (the focus color, the focused icon and affix colors, the loading and spinner colors); left unset, the accent is primary unless they say otherwise. |
| AriaDescription |
string? |
null |
Detailed description of the input for the benefit of screen readers. It is rendered into a visually hidden element that the input references through its aria-describedby attribute. |
| AriaPositionInSet |
int? |
null |
The position in the parent set (if in a set). |
| AriaSetSize |
int? |
null |
The total size of the parent set (if in a set). |
| AriaValueNow |
TValue? |
null |
Sets the control's aria-valuenow. Providing this only makes sense when using as a controlled component. |
| AriaValueText |
string? |
null |
Sets the control's aria-valuetext. |
| Background |
BitColorKind? |
null |
The color kind of the number field background (Primary by default). An explicit value wins over --bit-NumberField-background; left unset, the background is the primary kind unless it says otherwise. |
| Border |
BitColorKind? |
null |
The color kind of the number field border (Primary by default). An explicit value wins over --bit-NumberField-border-color and --bit-NumberField-hover-border-color; left unset, the border is the primary kind unless they say otherwise. |
| Classes |
BitNumberFieldClassStyles? |
null |
Custom CSS classes for different parts of the BitNumberField. |
| ContinuousSpinDelay |
int |
400 |
The delay in milliseconds before the value starts changing continuously while an increment/decrement button is held down. |
| ContinuousSpinInterval |
int |
75 |
The interval in milliseconds between two consecutive value changes while an increment/decrement button is held down. |
| Culture |
CultureInfo? |
null |
The culture the value is written and read in. Left unset, a NumberFormat renders in the culture of the current thread while the plain (unformatted) value is written and parsed with the invariant culture. Setting it pins both to one culture, so the field shows and accepts that culture's separators regardless of the thread. The aria-valuenow/valuemin/valuemax attributes stay invariant either way, and the culture's rendering is announced through aria-valuetext. |
| DecrementAriaLabel |
string? |
null |
Accessible label text for the decrement button (for screen reader users), useful for localization. Unset or blank, the button is named BitStrings.Current.DecreaseValue ("Decrease value" by default). |
| DecrementIcon |
BitIconInfo? |
null |
Gets or sets the icon to display on the decrement button using custom CSS classes for external icon libraries. Takes precedence over DecrementIconName when both are set. |
| DecrementIconName |
string? |
null |
Gets or sets the name of the icon for the decrement button from the built-in Fluent UI icons. For external icon libraries, use DecrementIcon instead. Unset, the button shows ChevronDownSmall. |
| DecrementTitle |
string? |
null |
The title to show when the mouse is placed on the decrement button. |
| Description |
string? |
null |
A hint rendered under the field, describing what is expected of it (e.g. the accepted range or the unit). Unlike AriaDescription it is visible, and the input references it through its aria-describedby attribute so it is announced along with the field. |
| DescriptionTemplate |
RenderFragment? |
null |
A custom template rendered in place of the Description, referenced by the input through its aria-describedby attribute just the same. |
| DigitsNormalizer |
Func<string?, string?>? |
null |
A custom function to normalize the raw input string before it gets parsed into the value. When provided, it takes precedence over NormalizeDigits and lets the developer plug in their own culture-specific or domain-specific transformation. |
| EnterKeyHint |
string? |
null |
The action label of the enter key on a virtual keyboard (enterkeyhint), e.g. "done", "next", "go", "search" or "send". On a numeric soft keyboard the key is otherwise unlabeled. |
| ErrorMessage |
string? |
null |
An error message rendered under the field, which also marks the field as invalid and is announced through a polite live region the moment it appears. It is the way to report what a validator outside of an EditContext found - a server-side check, a business rule - without having to build a form around the field. |
| ErrorMessageAriaLabel |
string? |
null |
The text a screen reader is given for a rejection that has no text of its own: an ErrorMessageTemplate, which is free to render anything at all, or the forced Invalid state. It is announced through the live region the moment the rejection shows up - in place of the default "Invalid input" for a template, and only when it is set for the forced state - and the input references it through aria-describedby, so the same reason is read out on every later focus too. A plain ErrorMessage is its own text and never uses it. Give it the reason the template shows, in the language of the page: a template switching to another reason is only announced again when this text switches along with it. Cascaded through BitParams it reaches every number field under it, so set it there only as a generic replacement for "Invalid input". |
| ErrorMessageTemplate |
RenderFragment? |
null |
A custom template rendered in place of the ErrorMessage, marking the field invalid and referenced by the input through its aria-describedby attribute just the same. It replaces the message for a screen reader as well: a template is free to render anything at all, so the live region announces ErrorMessageAriaLabel for it, or a bare "Invalid input" when that is not set. |
| FullWidth |
bool |
false |
Stretches the number field to the full width of its container. By default the field only takes the width it needs, which keeps a stepper from spanning a whole form row. |
| HideInput |
bool |
false |
Hides the text input element while keeping the increment/decrement buttons functional, turning the component into a stepper-only control. |
| IconAriaLabel |
string? |
null |
The aria label of the icon for the benefit of screen readers. |
| Icon |
BitIconInfo? |
null |
Gets or sets the icon to display alongside the number field using custom CSS classes for external icon libraries. Takes precedence over IconName when both are set. |
| IconName |
string? |
null |
Gets or sets the name of the icon to display alongside the number field from the built-in Fluent UI icons. For external icon libraries, use Icon instead. |
| IncrementAriaLabel |
string? |
null |
Accessible label text for the increment button (for screen reader users), useful for localization. Unset or blank, the button is named BitStrings.Current.IncreaseValue ("Increase value" by default). |
| IncrementIcon |
BitIconInfo? |
null |
Gets or sets the icon to display on the increment button using custom CSS classes for external icon libraries. Takes precedence over IncrementIconName when both are set. |
| IncrementIconName |
string? |
null |
Gets or sets the name of the icon for the increment button from the built-in Fluent UI icons. For external icon libraries, use IncrementIcon instead. Unset, the button shows ChevronDownSmall turned upside down. |
| IncrementTitle |
string? |
null |
The title to show when the mouse is placed on the increment button. |
| InputMode |
BitInputMode? |
null |
Overrides the virtual keyboard the browser shows for the input. By default it is Numeric for the integral types and Decimal for the fractional ones (float, double and decimal). Since neither of those keypads offers a minus sign on every platform, a field that has to accept negative values on touch devices is better served by Text, which brings up the full keyboard. |
| Invalid |
bool |
false |
Marks the field as invalid without a message of its own, for a rejection that is already explained elsewhere (a summary at the top of the form, a message beside a group of fields). It paints the field and renders aria-invalid exactly as a failing validation does, and says nothing more to a screen reader unless ErrorMessageAriaLabel gives it a reason to announce. |
| InvertMouseWheel |
bool |
false |
Reverses the direction of the value change when the user spins the value using the mouse wheel (the wheel only changes the value while the Shift key is held down, to keep normal page scrolling intact). |
| IsInputReadOnly |
bool |
false |
Makes only the text input part read-only, preventing typing, while the value can still be changed using the increment/decrement buttons, the arrow keys and the mouse wheel (unlike ReadOnly, which blocks all of them). |
| LabelPlacement |
BitPlacement? |
null |
The position of the label in regards to the field (Top by default). Only Top, Bottom, Start and End are honoured; any other value leaves the layout as it is with this unset. |
| Label |
string? |
null |
Descriptive label for the number field, rendered next to it (per LabelPlacement) and read by screen readers. |
| LabelTemplate |
RenderFragment? |
null |
Shows the custom Label for number field. If you don't call default label, ensure that you give your custom label an id and that you set the input's aria-labelledby prop to that id. |
| Min |
string? |
null |
The minimum value of the number field. Values below it get clamped to it, both when typed and when spinning. It is a string to support any numeric type of the field; an unparsable value falls back to the type's MinValue. |
| Loading |
bool |
false |
Shows a busy indicator inside the field, which is what tells the user that something is running against the value - a price being recalculated, a quantity being checked against stock. The field stays editable while it is on, so the typing and the stepping are never interrupted by it. |
| LoadingAriaLabel |
string? |
null |
What a screen reader announces while Loading is on, useful for localization. Unset or blank, it is BitStrings.Current.Loading ("Loading" by default). It is announced whichever indicator is drawn, and along with any error message shown at the time, so a LoadingTemplate drawing a bare spinner of its own, or a rejected value being checked again, still tells an assistive technology that something is running. |
| LoadingTemplate |
RenderFragment? |
null |
The custom content of the busy indicator, which replaces the default spinner. |
| Max |
string? |
null |
The maximum value of the number field. Values above it get clamped to it, both when typed and when spinning. It is a string to support any numeric type of the field; an unparsable value falls back to the type's MaxValue. |
| Mode |
BitSpinButtonMode? |
null |
Determines how the increment/decrement buttons render: Compact (stacked at the end of the input), Inline (side by side at the end) or Spread (one on each side). When null (default), no buttons render, while the value can still be changed using the arrow keys and the mouse wheel. |
| NoBorder |
bool |
false |
Removes the border of the number field, which is what you want when it sits inside a surface that already provides one (a toolbar, a table cell or a card). |
| NoClamp |
bool |
false |
Keeps values typed outside of the Min/Max range intact instead of clamping them to the nearest bound, so that a form validation (e.g. a [Range] data annotation) can report the out-of-range value to the user instead of it being silently corrected. Stepping with the increment/decrement buttons, the arrow keys or the mouse wheel still stays inside the range, and the Home/End keys still jump to the bounds. |
| NoMouseWheel |
bool |
false |
Disables changing the value using the mouse wheel entirely (by default the value changes when the wheel is scrolled over the focused field while the Shift key is held down). |
| NoSelectOnFocus |
bool |
false |
Disables the automatic select-all of the input's text when the field receives focus. |
| NormalizeDigits |
bool |
false |
Normalizes non-Latin (e.g. Persian "۱۲۳" or Arabic "١٢٣") decimal digits to their Latin (0-9) equivalents before parsing. This is culture-agnostic and works for any Unicode decimal digit system. |
| NumberFormat |
string? |
null |
The format of the number in the number field, using the standard or custom .NET numeric format strings (e.g. "N0", "C0" or "000000"). The formatting is applied whenever the value is committed, while the bound value stays a plain number. Value-scaling formats (like the percent "P" format) are not suitable, since the scaled display cannot be parsed back into the same value. |
| OnBlur |
EventCallback<FocusEventArgs> |
|
Callback for when the control loses focus. |
| OnClear |
EventCallback |
|
Callback executed when the user clears the number field by clicking the clear button. |
| OnClick |
EventCallback<MouseEventArgs> |
|
Callback for when the input is clicked. |
| OnDecrement |
EventCallback<TValue> |
|
Callback for when the decrement button or down arrow key is pressed. |
| OnEnter |
EventCallback<KeyboardEventArgs> |
|
Callback for when the Enter key is pressed on the input. It is invoked after the typed text has been committed, so the bound value it observes is already the one the user just entered. |
| OnEscape |
EventCallback<KeyboardEventArgs> |
|
Callback for when the Escape key is pressed on the input. It is invoked before the field clears itself (which it only does while a clear button is shown), so a handler is free to take the key for something else. |
| OnFocus |
EventCallback<FocusEventArgs> |
|
Callback for when focus moves into the input. |
| OnFocusIn |
EventCallback<FocusEventArgs> |
|
Callback for when focus moves into the input. |
| OnFocusOut |
EventCallback<FocusEventArgs> |
|
Callback for when focus moves out of the input. |
| OnIncrement |
EventCallback<TValue> |
|
Callback for when the increment button or up arrow key is pressed. |
| OnKeyDown |
EventCallback<KeyboardEventArgs> |
|
Callback for when a key is pressed down on the input. It is invoked for every key, including the ones the field handles itself (the arrow keys, PageUp/PageDown, Home/End and Escape). |
| OnKeyUp |
EventCallback<KeyboardEventArgs> |
|
Callback for when a key is released on the input. |
| OnMaxReached |
EventCallback<TValue> |
|
Callback for when a step lands the value on (or beyond) the explicit Max, letting the consumer react to the ceiling being hit. It only fires for an explicit Max, and only on the step that reaches it. |
| OnMinReached |
EventCallback<TValue> |
|
Callback for when a step lands the value on (or beyond) the explicit Min. It only fires for an explicit Min, and only on the step that reaches it. |
| PageStep |
string? |
null |
The amount by which the value changes when the user presses the PageUp/PageDown keys, providing a larger jump than the regular Step. It is a string to support any numeric type of the field; when not provided (or unparsable), PageUp/PageDown change the value by 10 times the Step. |
| ParsingErrorMessage |
string |
"The {0} field is not valid." |
The message format used for invalid values entered in the input. |
| Placeholder |
string? |
null |
Input placeholder text. |
| Precision |
int? |
null |
How many decimal places the value should be rounded to. When not provided, the precision is derived from the fractional digits of the Step parameter (if any); otherwise no rounding is applied. A negative value rounds to a power of ten (e.g. -2 rounds to the nearest hundred). |
| Prefix |
string? |
null |
Prefix displayed before the numeric field contents. This is not included in the value.
Ensure a descriptive label is present to assist screen readers, as the value does not include the prefix. |
| PrefixTemplate |
RenderFragment? |
null |
Shows the custom prefix for numeric field. |
| ClearButtonIcon |
BitIconInfo? |
null |
Gets or sets the icon to display on the clear button using custom CSS classes for external icon libraries. Takes precedence over ClearButtonIconName when both are set. |
| ClearButtonIconName |
string? |
null |
Gets or sets the name of the icon for the clear button from the built-in Fluent UI icons. For external icon libraries, use ClearButtonIcon instead. Unset, the button shows Cancel. |
| ClearButtonAriaLabel |
string? |
null |
Accessible label text for the clear button (for screen reader users), useful for localization. Unset or blank, the button is named BitStrings.Current.ClearValue ("Clear value" by default), whatever a ClearButtonTemplate shows in it. |
| ClearButtonTemplate |
RenderFragment? |
null |
A custom template rendered inside the clear button in place of its icon. The button itself - its accessible name, its click and Escape handling - stays the same. That name is ClearButtonAriaLabel, not the template: a template showing words (a visible "Reset") needs ClearButtonAriaLabel to contain them, or a voice-control user saying what they see finds no button. |
| ShowClearButton |
bool |
false |
Whether to show the clear button whenever the field is showing something, resetting the value to null with a single click (most useful with nullable value types). "Showing something" covers a string the user typed that failed to parse as well as a real value, so the button is also there to wipe an entry that has to be corrected. It is not rendered while the field is read-only or empty. It stays out of the tab order (like the increment/decrement buttons), the Escape key being the keyboard equivalent of clicking it - a press that is the field's alone, so a Dialog, a Modal, a Panel or an Overlay around it closes on the next one. |
| Size |
BitSize? |
null |
Sets the preset size (Small, Medium, Large) of the number field: the height of the control, its type scale, the size of its icons and the width of its buttons all follow it, so a field lines up with the other controls of the same size around it (Medium by default). An explicit value wins over the --bit-NumberField-* size variables (height, font sizes, inline padding, icon size, spinner size, button width and glyph size); left unset, the field is medium unless they say otherwise. |
| SnapToStep |
bool |
false |
Snaps the committed value to the nearest multiple of the Step (anchored at the Min when one is provided), so typed values align to the same grid that the increment/decrement stepping produces. Without it, typed values are kept as-is (aside from min/max clamping and precision rounding). |
| Step |
string? |
null |
The difference between two adjacent values of the number field, applied when spinning the value using the increment/decrement buttons, the Up/Down arrow keys or the mouse wheel. A fractional step (e.g. "0.01") also implies the rounding precision of the field, unless an explicit Precision is provided. It is a string to support any numeric type of the field; an unparsable value falls back to 1. |
| Styles |
BitNumberFieldClassStyles? |
null |
Custom CSS styles for different parts of the BitNumberField. |
| Suffix |
string? |
null |
Suffix displayed after the numeric field contents. This is not included in the value.
Ensure a descriptive label is present to assist screen readers, as the value does not include the suffix. |
| SuffixTemplate |
RenderFragment? |
null |
Shows the custom suffix for numeric field. |
| Title |
string? |
null |
A more descriptive title for the control, visible on its tooltip. |
| Underlined |
bool |
false |
Renders the number field with a single bottom rule instead of a full border, the classic "underlined" input variant. |