问题
用 Streamlit 构建数据应用的开发者,在做多步骤用户流程时缺一个内置的 stepper/wizard 组件(“This is not well supported in Streamlit today”);下拉框选项只能显示纯文本,无法渲染 markdown、HTML 或 LaTeX;文本输入框也没有 autofocus 参数来引导用户填写表单。这些都是构建引导式数据录入体验时反复碰到的小缺口,开发者目前只能等待官方排期或在 issue 里留言,issue 从 2021 年挂到现在仍未解决,说明靠官方补齐遥遥无期。
目标用户
用 Streamlit 快速搭建内部数据应用和原型的数据工程师、数据科学家及独立开发者。三条 issue 分别有 40、45、51 的互动分,属于长尾但全球性的开发者群体;单个需求 pain 较低(均为 2 分),更多是“不爽但能用”。
解决方案
- st_stepper 组件:横向/纵向步骤条,支持每步自定义图标,通过 session state 编程式控制当前步骤
- 富文本 select 组件:st.selectbox / st.multiselect 的替代品,选项可渲染 markdown、LaTeX(“Selectbox label can render markdown text, but options can't”)
- autofocus 支持:文本输入组件接受 focus/autofocus 参数,加载或某一步激活时自动聚焦指定输入框,引导用户填写
- 统一打包:以单一 pip 包 + 文档站交付,AI 在此处不是核心,本质是 React 组件工程
- AI 可选加分项:基于 LLM 根据表单字段自动生成步骤拆分建议,降低多步骤流程的搭建成本
MVP 范围
做: 一个 pip 可安装的 Streamlit 组件库,包含:
- Stepper/Wizard 组件(横向与纵向,支持 session state 编程式跳转与每步图标)
- 富文本 selectbox/multiselect 组件(选项渲染 markdown/LaTeX)
- 文本输入组件的 autofocus/focus 参数(可指定加载时聚焦哪个输入框) 不做:
- 不做通用 UI 组件大全(表格、图表等 Streamlit 已覆盖的)
- 不做托管服务或后端
- 不做对 Streamlit 核心的 fork,全部通过官方自定义组件机制实现
风险
- 平台依赖风险(最大): 生命周期完全绑定 Streamlit,官方随时可能内置这些组件(issue 已在官方仓库多年),一旦内置第三方库即失去存在价值
- 需求碎片化: 三个 issue 各自独立、pain 均为 2 分,是“不爽但可忍”级别,未必支撑一个独立产品
- 无付费证据: 全部为开源生态的免费诉求,变现路径不明,更适合作为开源作品引流而非直接收费
- 维护负担: 需要跟随 Streamlit 版本升级持续适配 React 组件层
已有产品
| 产品 | 定位 | 价格 |
|---|---|---|
| extra-streamlit-components | 已有的 Streamlit 第三方组件库,但按信号描述并未提供 stepper、markdown 选项或 autofocus 这些具体能力。 | — |
信号证据
这张卡片依据的原始讨论。摘录保持原文,点“原文”查看上下文。
GitHub Issues · streamlit/streamlit3月12日功能请求▲ 401 条评论
“Sometimes, people want to do apps where the user needs to go through multiple steps. This is not well supported in Streamlit today.”
Streamlit lacks a built-in stepper/wizard widget for guiding users through multiple discrete steps.原文
GitHub Issues · streamlit/streamlit10月1日功能请求▲ 455 条评论
“Selectbox label can render markdown text (from #863), but options can't. Options are only plain text.”
Las opciones de st.selectbox y st.multiselect en Streamlit solo admiten texto plano, no markdown, HTML o LaTeX.原文
GitHub Issues · streamlit/streamlit10月12日功能请求▲ 5114 条评论
“When users have to provide data via TextInput elements there should be a way to guide them through forms or text fields by activating them on load.”
Streamlit users need a way to set focus on text input widgets to guide users through forms.原文