Repository navigation
Streamlit Configurator v0.1.0b – Initial Release
Streamlit Configurator is a declarative and modular framework for building Streamlit applications, allowing you to define UI components and layouts in a more structured and maintainable way. This first release provides the core functionality for robust state management and layout construction, making it easier to share and reuse configurations across different pages within a Streamlit app.
Highlights
-
Declarative Layouts
Define pages and components using straightforward data structures (PageConfig,ComponentConfig), minimizing repetitive Streamlit calls. -
Robust State Management
LeveragePlaceholderValuefor storing and retrieving data across page refreshes or navigations, preventing common issues with session state resetting. -
Reusable Components
Build once, reuse everywhere. Easily maintain consistent design and logic by reusing configs across multiple pages. -
Integration & Compatibility
Enjoy the benefits of placeholders and declarative layouts alongside native Streamlit code. You can still write custom functions or directst.*calls wherever needed. -
Scalable Architecture
As your app grows, seamlessly add placeholders or restructure layouts without rewriting large sections of code.
Installation
pip install st-configurator(Once published on PyPI. For now, install from source.)
Quick Example
import streamlit as st
from st_configurator import ComponentConfig, PageConfig, PageRenderer
from st_configurator.placeholder import Placeholder, PlaceholderValue
class MyPlaceholder(Placeholder):
NAME = PlaceholderValue(default=\"Guest\")
name_input = ComponentConfig(
component=st.text_input,
args=(\"What's your name?\",),
kwargs={\"value\": MyPlaceholder.NAME},
result_key=MyPlaceholder.NAME
)
page_config = PageConfig(
page_tag=\"HomePage\",
body=[name_input]
)
PageRenderer().render_page(page_config)Run:
streamlit run your_script.pyChange pages, refresh, and notice the input is preserved thanks to placeholders.
Feedback & Contributions
Report issues, suggest features, or submit pull requests to help improve Streamlit Configurator. If you find this project useful, please give it a star ⭐ on GitHub. We appreciate your support and look forward to your feedback!