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

class

NumberPicker

public class NumberPicker : Input<NumberPicker>, ITextFormating, IHasBackgroundColor, IHasForegroundColor

A form input for entering a numeric value, with optional min/max bounds and step.

Namespace
Tesserae
Inheritance
Input<NumberPicker> → NumberPicker
Implements
ITextFormating, IHasBackgroundColor, IHasForegroundColor

Constructors

NameDescription
NumberPickerInitializes a new instance of this class.
Constructor
NumberPicker
public NumberPicker(int defaultValue = 0) : base("number", defaultValue.ToString())

Initializes a new instance of this class.

Properties

NameDescription
ValueGets or sets the current value of the component.
MaxGets or sets the maximum value accepted by the component.
MinGets or sets the minimum value accepted by the component.
StepGets or sets the step increment used by the component.
SizeGets or sets the size of the component.
WeightGets or sets the font weight of the component.
TextAlignGets or sets the text alignment of the component.
BackgroundGets or sets the CSS background of the component.
ForegroundGets or sets the CSS color (foreground) of the component.
Property
NumberPicker.Value
public int Value

Gets or sets the current value of the component.

Property
NumberPicker.Max
public int Max { get ; set ; }

Gets or sets the maximum value accepted by the component.

Property
NumberPicker.Min
public int Min { get ; set ; }

Gets or sets the minimum value accepted by the component.

Property
NumberPicker.Step
public int Step { get ; set ; }

Gets or sets the step increment used by the component.

Property
NumberPicker.Size
public TextSize Size { get ; set ; }

Gets or sets the size of the component.

Property
NumberPicker.Weight
public TextWeight Weight { get ; set ; }

Gets or sets the font weight of the component.

Property
NumberPicker.TextAlign
public TextAlign TextAlign { get ; set ; }

Gets or sets the text alignment of the component.

Property
NumberPicker.Background
public string Background { get ; set ; }

Gets or sets the CSS background of the component.

Property
NumberPicker.Foreground
public string Foreground { get ; set ; }

Gets or sets the CSS color (foreground) of the component.

Methods

NameDescription
SetMaxSets the max of the component.
SetMinSets the min of the component.
SetStepSets the step of the component.
Method
NumberPicker.SetMax
public NumberPicker SetMax(int max)

Sets the max of the component.

Method
NumberPicker.SetMin
public NumberPicker SetMin(int min)

Sets the min of the component.

Method
NumberPicker.SetStep
public NumberPicker SetStep(int step)

Sets the step 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.

See also

© 2026 Curiosity. All rights reserved.