๐ฆดย ย Skeleton Placeholder
Submitted by Lukas Masuch
Summary
A single-element container which displays a skeleton placeholder.
Functions
skeleton
Insert a single-element container which displays a "skeleton" placeholder.
Inserts a container into your app that can be used to hold a single element. This allows you to, for example, remove elements at any point, or replace several elements at once (using a child multi-element container).
To insert/replace/clear an element on the returned container, you can
use with
notation or just call methods directly on the returned object.
Parameters
height: int or None Desired height of the skeleton expressed in pixels. If None, a default height is used.
Source code in src/streamlit_extras/skeleton/__init__.py
Import:
- You should add this to the top of your .py file
Examples
example
def example():
st.write("This is the main container")
# Example 1: Basic usage
skeleton_container = skeleton()
tall_skeleton = skeleton(height=200)
if st.button("Fill skeleton container"):
skeleton_container.write("This is content in the skeleton container")
tall_skeleton.dataframe(
{
"A": [1, 2, 3],
"B": [4, 5, 6],
}
)