Streamlit Shadcn UI 1.2.0
This release adds the numeric input requested in
#55.
Users can type a value or press the decrement and increment buttons instead
of dragging a slider on a small screen.
import streamlit as st
import streamlit_shadcn_ui as ui
quantity = ui.number_input(
"Quantity", value=1, min_value=1, max_value=10, step=1, key="quantity"
)
threshold = ui.number_input("Threshold", value=0.2, step=0.1)
st.write(quantity, threshold)el.number_input offers the same control inside an Elements tree. Its handle
returns a Python number and its callback receives an ElementEvent.
Input behavior
- Integer arguments return an
int; any float argument selects float mode. - The default step is
1for integers or0.01for floats. Bounds are optional
and inclusive; equal bounds and steps larger than the range are supported. - Buttons use 44 px touch targets. Arrow Up/Down step the value; Home/End use
configured bounds. Scrolling over the input does not change its value. - Typing remains local until Enter or blur. Empty and invalid drafts restore
the last committed number. Fractional input in integer mode is rejected
rather than truncated. Valid out-of-range drafts clamp on commit. - Decimal steps are added using their decimal representations before conversion
back to JavaScript numbers, avoiding visible drift during repeated 0.1 steps. - Values persist across reruns; changed Python defaults use the existing
revisioned reset protocol. Disabled fields ignore interactions.
The component combines the repository's generated shadcn Input and Button.
It adds no runtime dependency, does not change generated shadcn sources, and
does not require an iframe or overlay layer.
Compatibility
Python 3.10+ and Streamlit 1.60+ remain supported. Existing component signatures
are unchanged. Upgrade with:
pip install --upgrade streamlit-shadcn-ui==1.2.0Numeric arguments must be finite and within +/- (2**53 - 1). value=None,
Decimal, currency formatting, locale-specific numeric text, and arbitrary
precision are outside this release's scope. Component values are returned by
the API; public st.session_state[key] numeric bindings are not provided.
See the Number Input API and examples, or run
streamlit run Home.py and open /NumberInput for the live examples.
Release verification
- 83 Python contract and application tests passed.
- 82 frontend unit tests, TypeScript, the production build, and the generated
source/import checks passed with Node 22.20.0 and pnpm 11.18.0. - Fresh wheel and sdist installs each rendered all 36 V2 component kinds in
Chromium, Firefox, and WebKit. Numeric values round-tripped to Python in
both standalone and Elements controls and survived unrelated reruns. - The wheel was tested on Python 3.10 with Streamlit 1.60.0; the sdist was
tested on Python 3.14 with Streamlit 1.61.1. - All 9 Elements browser scenarios and 13 existing inline-control scenarios
passed. Two visual cases are intentionally limited to Chromium and were
skipped on Firefox and WebKit. - A 390 px Chromium viewport with touch emulation verified tapping, decimal
steps, callback counts, and rerun persistence. Both step buttons measured
44 by 44 px, with no horizontal page overflow or iframe. Physical phone
keyboards and screen-reader announcements were not tested. - The fail-closed archive verifier and
twine checkpassed for both artifacts.
Release artifact SHA-256 checksums:
339c93de090c9c827818134664d64bae4f63eb44f92f8fd0615427638ca4eb99 streamlit_shadcn_ui-1.2.0-py3-none-any.whl
bc1870fed2442f5ddfa61dc9139d6ee0ab135a51de7654249967a131a11fe081 streamlit_shadcn_ui-1.2.0.tar.gz