number
A kind of input
that handles numbers.
Properties¶
Name | Type | Default | Description |
---|---|---|---|
(★) |
any dynamic |
The numerical value represented by this control. |
|
label |
str |
None | The label associated with the input. |
change_delay |
int |
App config | Minimum time between triggering two calls to the on_change callback. |
on_action |
Callback |
Name of a function that is triggered when a specific key is pressed.
|
|
action_keys |
str |
"Enter" | Semicolon (';')-separated list of supported key names. |
on_change |
Callback |
The name of a function that is triggered when the value is updated.
|
|
propagate |
bool |
App config | Allows the control's main value to be automatically propagated. |
active |
bool dynamic |
True | Indicates if this component is active. |
id |
str |
The identifier that will be assigned to the rendered HTML component. |
|
properties |
dict[str, any] |
Bound to a dictionary that contains additional properties for this element. |
|
class_name |
str dynamic |
The list of CSS class names that will be associated with the generated HTML Element. |
|
hover_text |
str dynamic |
The information that is displayed when the user hovers over this element. |
(★)value
is the default property for this visual element.
Styling¶
All the number controls are generated with the "taipy-number" CSS class. You can use this class name to select the number controls on your page and apply style.
Stylekit support¶
The Stylekit provides a specific class that you can use to style number controls:
- fullwidth
If a number control uses the fullwidth class, then it uses the whole available horizontal space.
Usage¶
Simple¶
You can create a number
input field bound to a numerical variable with the following content:
Definition
<|{value}|number|>
<taipy:number>{value}</taipy:number>
import taipy.gui.builder as tgb
...
tgb.number("{value}")