Skip to main content

streamlit-number-controller

A compact plus/minus number controller for Streamlit apps.

import streamlit as st
from streamlit_number_controller import number_controller

value = number_controller(
    title="Quantity",
    min_value=0,
    max_value=10,
    default_value=1,
    key="quantity",
    minus_color="#ef4444",
    plus_color="#2563eb",
    minus_button_color="#fee2e2",
    plus_button_color="#dbeafe",
)

st.write("Current value:", value)

Installation

pip install streamlit-number-controller

API

number_controller(
    title: str,
    min_value: int,
    max_value: int,
    default_value: int,
    *,
    key: str | None = None,
    step: int = 1,
    minus_icon: str = ":material/remove:",
    plus_icon: str = ":material/add:",
    minus_color: str | None = None,
    plus_color: str | None = None,
    minus_button_color: str | None = None,
    plus_button_color: str | None = None,
) -> int

The controller stores its value in st.session_state, keeps the displayed value and returned value in sync, and clamps changes to min_value / max_value.

Development

Run the example app:

streamlit run examples/app.py

Build the package:

python -m build

Upload to TestPyPI:

python -m twine upload --repository testpypi dist/*

Upload to PyPI:

python -m twine upload dist/*

Metadata

Release files for streamlit-number-controller 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-number-controller 0.1.0
File Size Uploaded Provenance Actions
streamlit_number_controller-0.1.0.tar.gz 3.7 kB Without provenance Details for streamlit_number_controller-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-number-controller 0.1.0
File Interpreter ABI Platform Actions
streamlit_number_controller-0.1.0-py3-none-any.whl Python 3 none any Details for streamlit_number_controller-0.1.0-py3-none-any.whl

Total release size: 8.3 kB

Release files / streamlit_number_controller-0.1.0.tar.gz

Download URL streamlit_number_controller-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
847ab7f0069600e8373204df7f67a55fc6b70a5c5ed2b43fb732e68855fc25d5
BLAKE2b-256 checksum
How to use checksums
7cde9c2c765c28e2ae235330d6ee75e6a45e283ddfd1df838d405d9ab690c27f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / streamlit_number_controller-0.1.0-py3-none-any.whl

Download URL streamlit_number_controller-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bb9671736b8c4495fd081f947b2605f569a280e3baa35364a0c37bc49ced80b
BLAKE2b-256 checksum
How to use checksums
ddcce3389c8e95aa832dc51e52dd4ddbebc74529a2ad360b1985a646f5efe059
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for streamlit-number-controller 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page