Skip to main content

A multi-step wizard component for Streamlit with validation and progress tracking

Project description

streamlit-stepper

A multi-step wizard component for Streamlit. Define steps with typed fields, get built-in validation, animated progress connectors, a summary review step, and the final collected values back in Python.

Stepper screenshot

Features

  • Horizontal (tabs across top) and vertical (sidebar) orientations — switchable at runtime
  • Animated fill connector between steps as you progress
  • Per-field required validation — blocks Next and shows inline error hints
  • Click completed steps to jump back
  • Auto-generated review step that summarizes all entries
  • Completion screen with collected values
  • Dot-strip navigation at the bottom of each step
  • Zero runtime dependencies beyond Streamlit

Installation

pip install streamlit-stepper

Quickstart

import streamlit as st
from streamlit_stepper import st_stepper

steps = [
    {
        "label": "Project",
        "subtitle": "Name & describe",
        "icon": "◈",
        "fields": [
            {
                "key": "name",
                "label": "Project name",
                "type": "text",
                "placeholder": "e.g. Apollo Dashboard",
                "required": True,
            },
            {
                "key": "type",
                "label": "Project type",
                "type": "select",
                "options": ["Web App", "Data Pipeline", "ML Model", "API Service"],
                "required": True,
            },
        ],
    },
    {
        "label": "Team",
        "subtitle": "Add collaborators",
        "icon": "◉",
        "fields": [
            {
                "key": "owner",
                "label": "Owner email",
                "type": "text",
                "placeholder": "you@company.com",
                "required": True,
            },
            {
                "key": "size",
                "label": "Team size",
                "type": "select",
                "options": ["Solo", "2–5", "6–15", "15+"],
                "required": True,
            },
        ],
    },
    {
        "label": "Review",
        "subtitle": "Confirm & launch",
        "icon": "◆",
        "fields": [],  # empty fields = auto review step
    },
]

result = st_stepper(steps, orientation="horizontal", key="wizard")

if result and result["completed"]:
    st.balloons()
    st.success(f"Created project: {result['values']['name']}")
    st.json(result["values"])

API

st_stepper(steps, orientation="horizontal", key=None)
Parameter Type Default Description
steps list[dict] required Step definitions
orientation "horizontal" | "vertical" "horizontal" Layout of the step indicator
key str None Streamlit widget key

Step schema

{
    "label":    str,        # short name in the indicator (e.g. "Project")
    "subtitle": str,        # secondary text below label
    "icon":     str,        # decorative character (e.g. "◈", "①", "→")
    "fields": [
        {
            "key":         str,          # returned in result["values"]
            "label":       str,          # field display label
            "type":        str,          # "text" | "textarea" | "select"
            "placeholder": str,          # optional hint text
            "required":    bool,         # if True, blocks Next when empty
            "options":     list[str],    # required for type="select"
        }
    ]
}

A step with "fields": [] renders as a review summary of all prior steps.

Return value

{
    "step":      int,   # index of the last completed step
    "values":    dict,  # {field_key: entered_value} for all fields
    "completed": bool,  # True when user clicks the final submit button
}

Development

git clone https://github.com/RhythrosaLabs/streamlit-stepper
cd streamlit-stepper

cd streamlit_stepper/frontend
npm install
npm start   # dev server on :3003

# separate terminal
cd ../..
pip install -e .
# Set _RELEASE = False in streamlit_stepper/__init__.py
streamlit run example.py

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_stepper-0.1.0.tar.gz (410.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_stepper-0.1.0-py3-none-any.whl (412.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_stepper-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_stepper-0.1.0.tar.gz
  • Upload date:
  • Size: 410.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for streamlit_stepper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 38633ee02d313cafa574e1dfffa6b871a0b91b14d9ad9bd3e872309bb902c7f3
MD5 0092001ae7ede20f9f9a9dae86786658
BLAKE2b-256 38cedcf74b77de9975ea7c3dd4d9819ced010a2bf4c1e81776ce59ee93f86579

See more details on using hashes here.

File details

Details for the file streamlit_stepper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_stepper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b6c9ba2326c84fe38945c164c179b39daf24c02c8350559ad31102c3223df6
MD5 b1911d5b9bbbb9cda00407a535bb0ba5
BLAKE2b-256 f1b4a092e873ddadadaf00ebb9f4490b63017156b887820ef8f65d981e954d37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page