components
InputNumeric(label, value=0, on_value=None, disabled=False, optional=False, continuous_update=False, clearable=False, classes=[], style=None, autofocus=False)
Numeric input (float | integers).
Basic example:
import solara
int_value = solara.reactive(42)
continuous_update = solara.reactive(True)
@solara.component
def Page():
solara.Checkbox(label="Continuous update", value=continuous_update)
solara.InputInt("Enter an integer number", value=int_value, continuous_update=continuous_update.value)
with solara.Row():
solara.Button("Clear", on_click=lambda: int_value.set(42))
solara.Markdown(f"**You entered**: {int_value.value}")
Arguments
label
: Label to display next to the slider.value
: The currently entered value.on_value
: Callback to call when the value changes.disabled
: Whether the input is disabled.optional
: Whether the value can be None.continuous_update
: Whether to call theon_value
callback on every change or only when the input loses focus or the enter key is pressed.clearable
: Whether the input can be cleared.classes
: List of CSS classes to apply to the input.style
: CSS style to apply to the input.autofocus
: Determines if a component is to be autofocused or not (Default is False). Autofocus will occur either during page load, or when the component becomes visible (for example, dialog being opened). Only one component per page should have autofocus on each such event.
Source code in hdxms_datasets/web/components.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|