A simple component that returns the dimensions of the container where it is rendered.
Project description
Streamlit - Container - Width
A simple streamlit component that returns the dimensions of the container where it is rendered. This may be used to format other components that require the dimensions of the container.
Notes and Limitations
If multiple st_container_width components will be used in the app, each component must be given a unique key value. Otherwise, the key argument is not required.
The current version only provides the width of the container in pixels.
Installation
pip install streamlit-container-width
Example
import streamlit as st
from streamlit_container_width import st_container_width
st.set_page_config(layout="wide")
st.title("Main Dimensions")
st.write(st_container_width(key="main"))
with st.sidebar:
st.title("Sidebar Dimensions")
st.write(st_container_width(key="sidebar"))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file streamlit_container_width-1.0.3.tar.gz.
File metadata
- Download URL: streamlit_container_width-1.0.3.tar.gz
- Upload date:
- Size: 499.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abab06ebedc229021f7e2076e5264699729900b7915aa2aac1c4f362d172e3be
|
|
| MD5 |
b4fc732e7e2345d9aa7778c04a2dd172
|
|
| BLAKE2b-256 |
1528d71b2b178ac049c447d644dfc02f64da81474bdf0140b082cea1e91e28b5
|