streamlit-stepper 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Your Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ recursive-include streamlit_stepper/frontend/build *
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: streamlit-stepper
3
+ Version: 0.1.0
4
+ Summary: A multi-step wizard component for Streamlit with validation and progress tracking
5
+ Home-page: https://github.com/RhythrosaLabs/streamlit-stepper
6
+ Author: Your Name
7
+ Author-email: you@example.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: streamlit>=1.28.0
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ # streamlit-stepper
27
+
28
+ 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.
29
+
30
+ ![Stepper screenshot](https://raw.githubusercontent.com/RhythrosaLabs/streamlit-stepper/main/docs/screenshot.png)
31
+
32
+ ## Features
33
+
34
+ - Horizontal (tabs across top) and vertical (sidebar) orientations — switchable at runtime
35
+ - Animated fill connector between steps as you progress
36
+ - Per-field required validation — blocks Next and shows inline error hints
37
+ - Click completed steps to jump back
38
+ - Auto-generated review step that summarizes all entries
39
+ - Completion screen with collected values
40
+ - Dot-strip navigation at the bottom of each step
41
+ - Zero runtime dependencies beyond Streamlit
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install streamlit-stepper
47
+ ```
48
+
49
+ ## Quickstart
50
+
51
+ ```python
52
+ import streamlit as st
53
+ from streamlit_stepper import st_stepper
54
+
55
+ steps = [
56
+ {
57
+ "label": "Project",
58
+ "subtitle": "Name & describe",
59
+ "icon": "◈",
60
+ "fields": [
61
+ {
62
+ "key": "name",
63
+ "label": "Project name",
64
+ "type": "text",
65
+ "placeholder": "e.g. Apollo Dashboard",
66
+ "required": True,
67
+ },
68
+ {
69
+ "key": "type",
70
+ "label": "Project type",
71
+ "type": "select",
72
+ "options": ["Web App", "Data Pipeline", "ML Model", "API Service"],
73
+ "required": True,
74
+ },
75
+ ],
76
+ },
77
+ {
78
+ "label": "Team",
79
+ "subtitle": "Add collaborators",
80
+ "icon": "◉",
81
+ "fields": [
82
+ {
83
+ "key": "owner",
84
+ "label": "Owner email",
85
+ "type": "text",
86
+ "placeholder": "you@company.com",
87
+ "required": True,
88
+ },
89
+ {
90
+ "key": "size",
91
+ "label": "Team size",
92
+ "type": "select",
93
+ "options": ["Solo", "2–5", "6–15", "15+"],
94
+ "required": True,
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ "label": "Review",
100
+ "subtitle": "Confirm & launch",
101
+ "icon": "◆",
102
+ "fields": [], # empty fields = auto review step
103
+ },
104
+ ]
105
+
106
+ result = st_stepper(steps, orientation="horizontal", key="wizard")
107
+
108
+ if result and result["completed"]:
109
+ st.balloons()
110
+ st.success(f"Created project: {result['values']['name']}")
111
+ st.json(result["values"])
112
+ ```
113
+
114
+ ## API
115
+
116
+ ```python
117
+ st_stepper(steps, orientation="horizontal", key=None)
118
+ ```
119
+
120
+ | Parameter | Type | Default | Description |
121
+ |-----------|------|---------|-------------|
122
+ | `steps` | `list[dict]` | required | Step definitions |
123
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout of the step indicator |
124
+ | `key` | `str` | `None` | Streamlit widget key |
125
+
126
+ ### Step schema
127
+
128
+ ```python
129
+ {
130
+ "label": str, # short name in the indicator (e.g. "Project")
131
+ "subtitle": str, # secondary text below label
132
+ "icon": str, # decorative character (e.g. "◈", "①", "→")
133
+ "fields": [
134
+ {
135
+ "key": str, # returned in result["values"]
136
+ "label": str, # field display label
137
+ "type": str, # "text" | "textarea" | "select"
138
+ "placeholder": str, # optional hint text
139
+ "required": bool, # if True, blocks Next when empty
140
+ "options": list[str], # required for type="select"
141
+ }
142
+ ]
143
+ }
144
+ ```
145
+
146
+ A step with `"fields": []` renders as a review summary of all prior steps.
147
+
148
+ ### Return value
149
+
150
+ ```python
151
+ {
152
+ "step": int, # index of the last completed step
153
+ "values": dict, # {field_key: entered_value} for all fields
154
+ "completed": bool, # True when user clicks the final submit button
155
+ }
156
+ ```
157
+
158
+ ## Development
159
+
160
+ ```bash
161
+ git clone https://github.com/RhythrosaLabs/streamlit-stepper
162
+ cd streamlit-stepper
163
+
164
+ cd streamlit_stepper/frontend
165
+ npm install
166
+ npm start # dev server on :3003
167
+
168
+ # separate terminal
169
+ cd ../..
170
+ pip install -e .
171
+ # Set _RELEASE = False in streamlit_stepper/__init__.py
172
+ streamlit run example.py
173
+ ```
174
+
175
+ ## License
176
+
177
+ MIT
@@ -0,0 +1,152 @@
1
+ # streamlit-stepper
2
+
3
+ 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.
4
+
5
+ ![Stepper screenshot](https://raw.githubusercontent.com/RhythrosaLabs/streamlit-stepper/main/docs/screenshot.png)
6
+
7
+ ## Features
8
+
9
+ - Horizontal (tabs across top) and vertical (sidebar) orientations — switchable at runtime
10
+ - Animated fill connector between steps as you progress
11
+ - Per-field required validation — blocks Next and shows inline error hints
12
+ - Click completed steps to jump back
13
+ - Auto-generated review step that summarizes all entries
14
+ - Completion screen with collected values
15
+ - Dot-strip navigation at the bottom of each step
16
+ - Zero runtime dependencies beyond Streamlit
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install streamlit-stepper
22
+ ```
23
+
24
+ ## Quickstart
25
+
26
+ ```python
27
+ import streamlit as st
28
+ from streamlit_stepper import st_stepper
29
+
30
+ steps = [
31
+ {
32
+ "label": "Project",
33
+ "subtitle": "Name & describe",
34
+ "icon": "◈",
35
+ "fields": [
36
+ {
37
+ "key": "name",
38
+ "label": "Project name",
39
+ "type": "text",
40
+ "placeholder": "e.g. Apollo Dashboard",
41
+ "required": True,
42
+ },
43
+ {
44
+ "key": "type",
45
+ "label": "Project type",
46
+ "type": "select",
47
+ "options": ["Web App", "Data Pipeline", "ML Model", "API Service"],
48
+ "required": True,
49
+ },
50
+ ],
51
+ },
52
+ {
53
+ "label": "Team",
54
+ "subtitle": "Add collaborators",
55
+ "icon": "◉",
56
+ "fields": [
57
+ {
58
+ "key": "owner",
59
+ "label": "Owner email",
60
+ "type": "text",
61
+ "placeholder": "you@company.com",
62
+ "required": True,
63
+ },
64
+ {
65
+ "key": "size",
66
+ "label": "Team size",
67
+ "type": "select",
68
+ "options": ["Solo", "2–5", "6–15", "15+"],
69
+ "required": True,
70
+ },
71
+ ],
72
+ },
73
+ {
74
+ "label": "Review",
75
+ "subtitle": "Confirm & launch",
76
+ "icon": "◆",
77
+ "fields": [], # empty fields = auto review step
78
+ },
79
+ ]
80
+
81
+ result = st_stepper(steps, orientation="horizontal", key="wizard")
82
+
83
+ if result and result["completed"]:
84
+ st.balloons()
85
+ st.success(f"Created project: {result['values']['name']}")
86
+ st.json(result["values"])
87
+ ```
88
+
89
+ ## API
90
+
91
+ ```python
92
+ st_stepper(steps, orientation="horizontal", key=None)
93
+ ```
94
+
95
+ | Parameter | Type | Default | Description |
96
+ |-----------|------|---------|-------------|
97
+ | `steps` | `list[dict]` | required | Step definitions |
98
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout of the step indicator |
99
+ | `key` | `str` | `None` | Streamlit widget key |
100
+
101
+ ### Step schema
102
+
103
+ ```python
104
+ {
105
+ "label": str, # short name in the indicator (e.g. "Project")
106
+ "subtitle": str, # secondary text below label
107
+ "icon": str, # decorative character (e.g. "◈", "①", "→")
108
+ "fields": [
109
+ {
110
+ "key": str, # returned in result["values"]
111
+ "label": str, # field display label
112
+ "type": str, # "text" | "textarea" | "select"
113
+ "placeholder": str, # optional hint text
114
+ "required": bool, # if True, blocks Next when empty
115
+ "options": list[str], # required for type="select"
116
+ }
117
+ ]
118
+ }
119
+ ```
120
+
121
+ A step with `"fields": []` renders as a review summary of all prior steps.
122
+
123
+ ### Return value
124
+
125
+ ```python
126
+ {
127
+ "step": int, # index of the last completed step
128
+ "values": dict, # {field_key: entered_value} for all fields
129
+ "completed": bool, # True when user clicks the final submit button
130
+ }
131
+ ```
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ git clone https://github.com/RhythrosaLabs/streamlit-stepper
137
+ cd streamlit-stepper
138
+
139
+ cd streamlit_stepper/frontend
140
+ npm install
141
+ npm start # dev server on :3003
142
+
143
+ # separate terminal
144
+ cd ../..
145
+ pip install -e .
146
+ # Set _RELEASE = False in streamlit_stepper/__init__.py
147
+ streamlit run example.py
148
+ ```
149
+
150
+ ## License
151
+
152
+ MIT
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,21 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="streamlit-stepper",
5
+ version="0.1.0",
6
+ author="Your Name",
7
+ author_email="you@example.com",
8
+ description="A multi-step wizard component for Streamlit with validation and progress tracking",
9
+ long_description=open("README.md").read(),
10
+ long_description_content_type="text/markdown",
11
+ url="https://github.com/RhythrosaLabs/streamlit-stepper",
12
+ packages=find_packages(),
13
+ include_package_data=True,
14
+ classifiers=[
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ],
19
+ python_requires=">=3.8",
20
+ install_requires=["streamlit>=1.28.0"],
21
+ )
@@ -0,0 +1,83 @@
1
+ import os
2
+ import streamlit.components.v1 as components
3
+
4
+ _RELEASE = True
5
+
6
+ if _RELEASE:
7
+ _component_func = components.declare_component(
8
+ "streamlit_stepper",
9
+ path=os.path.join(os.path.dirname(__file__), "frontend/build"),
10
+ )
11
+ else:
12
+ _component_func = components.declare_component(
13
+ "streamlit_stepper",
14
+ url="http://localhost:3001",
15
+ )
16
+
17
+
18
+ def st_stepper(steps, orientation="horizontal", key=None):
19
+ """
20
+ Render a multi-step wizard with validated fields and progress tracking.
21
+
22
+ Parameters
23
+ ----------
24
+ steps : list[dict]
25
+ Ordered list of step definitions. Each dict accepts:
26
+
27
+ - ``label`` (str): short step name shown in the indicator
28
+ - ``subtitle`` (str): secondary label shown below
29
+ - ``icon`` (str): single character/symbol shown in the header (e.g. "◈")
30
+ - ``fields`` (list[dict]): form fields for this step. Each field::
31
+
32
+ {
33
+ "key": str, # unique key, returned in values
34
+ "label": str, # display label
35
+ "type": str, # "text" | "textarea" | "select"
36
+ "placeholder": str, # optional
37
+ "required": bool, # blocks Next if empty
38
+ "options": list[str], # required for type="select"
39
+ }
40
+
41
+ orientation : {"horizontal", "vertical"}
42
+ Layout of the step indicator. "horizontal" shows steps across the top;
43
+ "vertical" shows a sidebar. Default "horizontal".
44
+ key : str, optional
45
+ Streamlit widget key.
46
+
47
+ Returns
48
+ -------
49
+ dict | None
50
+ On final submission returns::
51
+
52
+ {
53
+ "step": int, # 0-indexed completed step count
54
+ "values": dict, # {field_key: value} for all fields
55
+ "completed": bool, # True when user clicks the final button
56
+ }
57
+
58
+ Returns None until completion.
59
+
60
+ Example
61
+ -------
62
+ >>> from streamlit_stepper import st_stepper
63
+ >>>
64
+ >>> steps = [
65
+ ... {
66
+ ... "label": "Basics", "subtitle": "Name & type", "icon": "◈",
67
+ ... "fields": [
68
+ ... {"key": "name", "label": "Project name", "type": "text", "required": True},
69
+ ... {"key": "type", "label": "Type", "type": "select",
70
+ ... "options": ["Web App", "API", "ML Model"], "required": True},
71
+ ... ],
72
+ ... },
73
+ ... {
74
+ ... "label": "Review", "subtitle": "Confirm", "icon": "◆",
75
+ ... "fields": [],
76
+ ... },
77
+ ... ]
78
+ >>>
79
+ >>> result = st_stepper(steps, orientation="horizontal", key="wizard")
80
+ >>> if result and result["completed"]:
81
+ ... st.success(f"Created: {result['values']['name']}")
82
+ """
83
+ return _component_func(steps=steps, orientation=orientation, key=key, default=None)
@@ -0,0 +1,10 @@
1
+ {
2
+ "files": {
3
+ "main.js": "./static/js/main.4e35496f.js",
4
+ "index.html": "./index.html",
5
+ "main.4e35496f.js.map": "./static/js/main.4e35496f.js.map"
6
+ },
7
+ "entrypoints": [
8
+ "static/js/main.4e35496f.js"
9
+ ]
10
+ }
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Streamlit Stepper</title><script defer="defer" src="./static/js/main.4e35496f.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>