Number¶
- class marimo.ui.number(start: float | None = None, stop: float | None = None, step: float | None = None, value: float | None = None, debounce: bool = False, *, label: str = '', on_change: Callable[[int | float | None], None] | None = None, full_width: bool = False)¶
A number picker over an interval.
Example.
number = mo.ui.number(start=1, stop=10, step=2)
Or from a dataframe series:
number = mo.ui.number.from_series(df["column_name"])
Attributes.
value
: the value of the number, possiblyNone
start
: the minimum value of the intervalstop
: the maximum value of the intervalstep
: the number increment
Initialization Args.
start
: optional, the minimum value of the intervalstop
: optional, the maximum value of the intervalstep
: the number incrementvalue
: default valuedebounce
: whether to debounce (rate-limit) value updates from the frontendlabel
: markdown label for the elementon_change
: optional callback to run when this element’s value changesfull_width
: whether the input should take up the full width of its container
Public methods
from_series
(series, **kwargs)Create a number picker from a dataframe series.
Inherited from
UIElement
form
([label, bordered, loading, ...])Create a submittable form out of this
UIElement
.send_message
(message, buffers)Send a message to the element rendered on the frontend from the backend.
Inherited from
Html
batch
(**elements)Convert an HTML object with templated text into a UI element.
center
()Center an item.
right
()Right-justify.
left
()Left-justify.
callout
([kind])Create a callout containing this HTML element.
style
([style])Wrap an object in a styled container.
Public Data Attributes:
Inherited from
UIElement
value
The element’s current value.
Inherited from
Html
text
A string of HTML representing this element.