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.3.0.tar.gz (411.1 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.3.0-py3-none-any.whl (413.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: streamlit_stepper-0.3.0.tar.gz
  • Upload date:
  • Size: 411.1 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.3.0.tar.gz
Algorithm Hash digest
SHA256 73389d2064b64cd4fe50a402d02c864f188cb769382c0d0738b99b95503073c0
MD5 c8937ef6ddb795ed73929e28774ab54d
BLAKE2b-256 8f8861f9402bf56d5e565062fe94c7c5830809224461cead4458c588b86638f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamlit_stepper-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 217427fa5bfd5bf740dab3b52e1ff0535b32df1db7dd7c94757262525c06c77a
MD5 2945d631212fca22042ec7d24a349145
BLAKE2b-256 d49afcdf46a9451753a262f856678c0d84bf2cd507c9eead95eed448b76159a0

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