NumberPicker
Description
The NumberPicker component is a numeric input control that leverages the native HTML number input field. It provides a fluent API to configure properties such as minimum, maximum, and step values. As part of the Tesserae Components group, it is ideal for scenarios where users need to select or input a numerical value. In addition, it supports text formatting features and style customizations like background and foreground colors.
Usage
Instantiate a NumberPicker using the Tesserae.UI helper method. You can create a default NumberPicker or initialize it with a starting value, and then chain configuration methods to set properties like minimum, maximum, or step values.
API reference
public class NumberPicker : Input<NumberPicker>, ITextFormating, IHasBackgroundColor, IHasForegroundColorA form input for entering a numeric value, with optional min/max bounds and step.
Constructors
Properties
public int Max { get ; set ; }Gets or sets the maximum value accepted by the component.
public int Min { get ; set ; }Gets or sets the minimum value accepted by the component.
public int Step { get ; set ; }Gets or sets the step increment used by the component.
public TextSize Size { get ; set ; }Gets or sets the size of the component.
public TextWeight Weight { get ; set ; }Gets or sets the font weight of the component.
public TextAlign TextAlign { get ; set ; }Gets or sets the text alignment of the component.
public string Background { get ; set ; }Gets or sets the CSS background of the component.
Samples
Basic NumberPicker Configurations
The following sample demonstrates different configurations of the NumberPicker, including default initial values, step increments, minimum and maximum constraints, and the disabled/required states.