Example Usage

import zero_true as zt

# Create a NumberInput component
number_input = zt.NumberInput(
  id="sample_number_input",
  disabled=False,             # If true, the input is disabled
  hint="Press Enter to Submit",  # Hint text for the number input
  label="Enter a Number",     # Label for the number input
  placeholder=0,              # Placeholder number
  readonly=False,             # If true, the input is read-only
  triggerEvent="change",      # Trigger event to send code to the backend
  type="number",              # Ensures that only numbers are accepted on the frontend
  value=None                  # The input number value
)

# Assuming you have a mechanism to render or use this NumberInput within a layout
layout = zt.Layout(components=[number_input])

Example Output

Overview

pydantic model zero_true.NumberInput

The NumberInput component is designed for scenarios where users need to enter numerical data, either as integers or floating-point numbers. This versatile input field supports features such as placeholders, hints, and labels to guide users during data entry.

Additionally, it can be set to a read-only or disabled state depending on the context of use. The component ensures that only numeric inputs are accepted, making it suitable for applications requiring precise numerical data inputs, such as financial, scientific, or statistical tools.

JSON Schema

Bellow are the various attributes you can assign to the component. Utlizing them can allow for modifications to the pre-created object.
zero_true.NumberInput
Zero True Component

Methods

classmethod get_value_from_global_state(value, values)