Repository navigation
v0.1.6
Full Changelog: v0.1.5...v0.1.6
[0.1.6] - 2026-04-08
Element fiber, unified state API, and API surface cleanup.
Added
ElementFiber— every renderedElementnow has a lightweight fiber inst.session_stateholding its path, widget key, hooks, and a post-processed value cache.- Hook support in
Element.render():use_effect,use_memo,use_ref,use_callback,use_previous,use_id, anduse_contextall work inside custom element subclasses (same rules as inComponent, exceptuse_statewhich is reserved for functional components). get_state(path_or_ref=None)— unified state accessor that works for both Elements and Components:- for an Element it returns an
ElementStatewith avaluefield - for a Component it returns its
Statedict - returns
Noneif the path doesn't resolve to a live fiber
- for an Element it returns an
ElementState— aStatesubclass with a singlevaluefield, returned byElementFiber.state.
Changed
- Unified element value storage: all Streamlit-keyed widget values are now stored under
{path}.raw(previously.value). The.rawsuffix makes the Streamlit-owned key explicit and leaves.valueunambiguous as the post-processed accessor viaElementState.value. get_statereplacesget_element_valueandget_component_state: both old functions still exist for backwards compatibility but the unifiedget_stateis now the documented API.Ref.state()is now the only state accessor onRef:ref.value()has been removed. Useref.state().valueto read an element value through a ref.ElementFiber.stateis a computed modict field that reads from the fiber's cache if set, or falls back tost.session_state[widget_key].- README and examples updated throughout to use
get_state(...)andref.state().value.