Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avsolatorio/streamlit-dimensions
A simple streamlit component that returns the dimensions of the container where it is rendered.
https://github.com/avsolatorio/streamlit-dimensions
streamlit
Last synced: 3 months ago
JSON representation
A simple streamlit component that returns the dimensions of the container where it is rendered.
- Host: GitHub
- URL: https://github.com/avsolatorio/streamlit-dimensions
- Owner: avsolatorio
- License: mit
- Created: 2022-03-18T01:27:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-18T07:47:05.000Z (almost 3 years ago)
- Last Synced: 2024-10-01T15:44:00.246Z (4 months ago)
- Topics: streamlit
- Language: Python
- Homepage:
- Size: 383 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Streamlit - Dimensions
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_dimensions` 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
```shell script
pip install streamlit-dimensions
```## Example
```python
import streamlit as st
from streamlit_dimensions import st_dimensionsst.set_page_config(layout="wide")
st.title("Main Dimensions")
st.write(st_dimensions(key="main"))with st.sidebar:
st.title("Sidebar Dimensions")
st.write(st_dimensions(key="sidebar"))```
![demo-app](img/demo-app.png)