Skip to content

A demo showing some tips for managing component state during reuse

Notifications You must be signed in to change notification settings

omnata-labs/streamlit-state-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

streamlit-state-demo

A demo showing some tips for managing component state during reuse.

This repo contains:

  • A python module (widget_base.py), which contains a base class you can extend when creating reusable Streamlit widgets
  • An example (streamlit_app.py), which contains an example of this class being used in Streamlit to create a table chooser widget.

The WidgetBase class automatically isolates the session state of its Streamlit fields, by inspecting the stack trace and creating a namespace.

It also encourages separation of state management and rendering. This encourages the "result" of some UI selections to be useful downstream, even if the fields are no longer rendered.

About

A demo showing some tips for managing component state during reuse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages