ui.input_numeric(id, label, value, *, min=None, max=None, step=None, width=None)

Create an input control for entry of numeric values.


id: str

An input id.

label: TagChild

An input label.

value: float

Initial value.

min: Optional[float] = None

The minimum allowed value.

max: Optional[float] = None

The maximum allowed value.

step: Optional[float] = None

Interval to use when stepping between min and max.

width: Optional[str] = None

The CSS width, e.g. ‘400px’, or ‘100%’


Type Description
Tag A UI element.


Server value

A numeric value.

See Also


#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file: app.py
from shiny import App, Inputs, Outputs, Session, render, ui

app_ui = ui.page_fluid(
    ui.input_numeric("obs", "Observations:", 10, min=1, max=100),

def server(input: Inputs, output: Outputs, session: Session):
    def value():
        return input.obs()

app = App(app_ui, server)