Skip to content

Commit 463b46d

Browse files
Release 1.32.0 (#988)
* Update streamlit.json * Add new `AppTest` properties * Update split to only split on spaces, so that newlines don't get removed (#957) * Update split to only split on spaces, so that newlines don't get removed Useful for people who want to stream markdown Thanks to @lukasmasuch for pointing out this solution * Update example to match docstring --------- Co-authored-by: Debbie Matthews <[email protected]> * Add `st.popover` (#987) * Add `st.popover` reference page * Add popover API reference cards * Cheat sheet, What's new, Release notes * Typos * Add release video links --------- Co-authored-by: Zachary Blackwood <[email protected]>
1 parent 482c21f commit 463b46d

File tree

13 files changed

+9275
-138
lines changed

13 files changed

+9275
-138
lines changed

components/layouts/masonry.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.Container {
2-
@apply columns-1 lg:columns-2 2xl:columns-3 gap-8 max-w-full;
2+
@apply columns-1 lg:columns-2 gap-8 max-w-full;
33
}
44

55
.Container > * {

content/library/api-cheat-sheet.md

+33-13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ This is a summary of the docs, as of [Streamlit v1.31.0](https://pypi.org/projec
1414
#### Install & Import
1515

1616
```python
17+
pip install streamlit
18+
1719
streamlit run first_app.py
1820

1921
# Import convention
@@ -24,31 +26,31 @@ streamlit run first_app.py
2426

2527
<CodeTile featured>
2628

27-
#### Command line
29+
#### Pre-release features
2830

2931
```python
30-
streamlit --help
31-
streamlit run your_script.py
32-
streamlit hello
33-
streamlit config show
34-
streamlit cache clear
35-
streamlit docs
36-
streamlit --version
32+
pip uninstall streamlit
33+
pip install streamlit-nightly --upgrade
3734
```
3835

36+
Learn more about [experimental features](advanced-features/prerelease#experimental-features)
37+
3938
</CodeTile>
4039

4140
<CodeTile featured>
4241

43-
#### Pre-release features
42+
#### Command line
4443

4544
```python
46-
pip uninstall streamlit
47-
pip install streamlit-nightly --upgrade
45+
streamlit --help
46+
streamlit run your_script.py
47+
streamlit hello
48+
streamlit config show
49+
streamlit cache clear
50+
streamlit docs
51+
streamlit --version
4852
```
4953

50-
Learn more about [experimental features](advanced-features/prerelease#experimental-features)
51-
5254
</CodeTile>
5355

5456
</Masonry>
@@ -114,6 +116,7 @@ st.metric("My metric", 42, 2)
114116
st.image("./header.png")
115117
st.audio(data)
116118
st.video(data)
119+
st.video(data, subtitles="./subs.vtt")
117120
```
118121

119122
</CodeTile>
@@ -195,6 +198,23 @@ st.vega_lite_chart(df)
195198

196199
<CodeTile>
197200

201+
#### Expandable containers
202+
203+
```python
204+
>>> expand = st.expander("My label")
205+
>>> expand.write("Inside the expander.")
206+
>>> pop = st.popover("Button label")
207+
>>> pop.checkbox("Show all")
208+
209+
# You can also use "with" notation:
210+
>>> with expand:
211+
>>> st.radio("Select one:", [1, 2])
212+
```
213+
214+
</CodeTile>
215+
216+
<CodeTile>
217+
198218
#### Control flow
199219

200220
```python

content/library/api/api-reference.md

+50-36
Original file line numberDiff line numberDiff line change
@@ -1305,47 +1305,50 @@ st_lottie(lottie_hello, key="hello")
13051305
## Layouts and containers
13061306

13071307
<TileContainer>
1308-
<RefCard href="/library/api-reference/layout/st.sidebar">
1308+
<RefCard href="/library/api-reference/layout/st.columns">
13091309

1310-
<Image pure alt="screenshot" src="/images/api/sidebar.jpg" />
1310+
<Image pure alt="screenshot" src="/images/api/columns.jpg" />
13111311

1312-
<h4>Sidebar</h4>
1312+
<h4>Columns</h4>
13131313

1314-
Display items in a sidebar.
1314+
Insert containers laid out as side-by-side columns.
13151315

13161316
```python
1317-
st.sidebar.write("This lives in the sidebar")
1318-
st.sidebar.button("Click me!")
1317+
col1, col2 = st.columns(2)
1318+
col1.write("this is column 1")
1319+
col2.write("this is column 2")
13191320
```
13201321

13211322
</RefCard>
1322-
<RefCard href="/library/api-reference/layout/st.columns">
1323+
<RefCard href="/library/api-reference/layout/st.container">
13231324

1324-
<Image pure alt="screenshot" src="/images/api/columns.jpg" />
1325+
<Image pure alt="screenshot" src="/images/api/container.jpg" />
13251326

1326-
<h4>Columns</h4>
1327+
<h4>Container</h4>
13271328

1328-
Insert containers laid out as side-by-side columns.
1329+
Insert a multi-element container.
13291330

13301331
```python
1331-
col1, col2 = st.columns(2)
1332-
col1.write("this is column 1")
1333-
col2.write("this is column 2")
1332+
c = st.container()
1333+
st.write("This will show last")
1334+
c.write("This will show first")
1335+
c.write("This will show second")
13341336
```
13351337

13361338
</RefCard>
1337-
<RefCard href="/library/api-reference/layout/st.tabs">
1339+
<RefCard href="/library/api-reference/layout/st.empty">
13381340

1339-
<Image pure alt="screenshot" src="/images/api/tabs.jpg" />
1341+
<Image pure alt="screenshot" src="/images/api/empty.jpg" />
13401342

1341-
<h4>Tabs</h4>
1343+
<h4>Empty</h4>
13421344

1343-
Insert containers separated into tabs.
1345+
Insert a single-element container.
13441346

13451347
```python
1346-
tab1, tab2 = st.tabs(["Tab 1", "Tab2"])
1347-
tab1.write("this is tab 1")
1348-
tab2.write("this is tab 2")
1348+
c = st.empty()
1349+
st.write("This will show last")
1350+
c.write("This will be replaced")
1351+
c.write("This will show first")
13491352
```
13501353

13511354
</RefCard>
@@ -1363,35 +1366,46 @@ with st.expander("Open to see more"):
13631366
```
13641367

13651368
</RefCard>
1366-
<RefCard href="/library/api-reference/layout/st.container">
1369+
<RefCard href="/library/api-reference/layout/st.popover">
13671370

1368-
<Image pure alt="screenshot" src="/images/api/container.jpg" />
1371+
<Image pure alt="screenshot" src="/images/api/popover.svg" />
13691372

1370-
<h4>Container</h4>
1373+
<h4>Popover</h4>
13711374

1372-
Insert a multi-element container.
1375+
Insert a multi-element popover container that can be opened/closed.
13731376

13741377
```python
1375-
c = st.container()
1376-
st.write("This will show last")
1377-
c.write("This will show first")
1378-
c.write("This will show second")
1378+
with st.popover("Settings"):
1379+
st.checkbox("Show completed")
13791380
```
13801381

13811382
</RefCard>
1382-
<RefCard href="/library/api-reference/layout/st.empty">
1383+
<RefCard href="/library/api-reference/layout/st.sidebar">
13831384

1384-
<Image pure alt="screenshot" src="/images/api/empty.jpg" />
1385+
<Image pure alt="screenshot" src="/images/api/sidebar.jpg" />
13851386

1386-
<h4>Empty</h4>
1387+
<h4>Sidebar</h4>
13871388

1388-
Insert a single-element container.
1389+
Display items in a sidebar.
13891390

13901391
```python
1391-
c = st.empty()
1392-
st.write("This will show last")
1393-
c.write("This will be replaced")
1394-
c.write("This will show first")
1392+
st.sidebar.write("This lives in the sidebar")
1393+
st.sidebar.button("Click me!")
1394+
```
1395+
1396+
</RefCard>
1397+
<RefCard href="/library/api-reference/layout/st.tabs">
1398+
1399+
<Image pure alt="screenshot" src="/images/api/tabs.jpg" />
1400+
1401+
<h4>Tabs</h4>
1402+
1403+
Insert containers separated into tabs.
1404+
1405+
```python
1406+
tab1, tab2 = st.tabs(["Tab 1", "Tab2"])
1407+
tab1.write("this is tab 1")
1408+
tab2.write("this is tab 2")
13951409
```
13961410

13971411
</RefCard>

content/library/api/layout/layout.md

+50-36
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,50 @@ slug: /library/api-reference/layout
1010
Streamlit provides several options for controlling how different elements are laid out on the screen.
1111

1212
<TileContainer>
13-
<RefCard href="/library/api-reference/layout/st.sidebar">
13+
<RefCard href="/library/api-reference/layout/st.columns">
1414

15-
<Image pure alt="screenshot" src="/images/api/sidebar.jpg" />
15+
<Image pure alt="screenshot" src="/images/api/columns.jpg" />
1616

17-
<h4>Sidebar</h4>
17+
<h4>Columns</h4>
1818

19-
Display items in a sidebar.
19+
Insert containers laid out as side-by-side columns.
2020

2121
```python
22-
st.sidebar.write("This lives in the sidebar")
23-
st.sidebar.button("Click me!")
22+
col1, col2 = st.columns(2)
23+
col1.write("this is column 1")
24+
col2.write("this is column 2")
2425
```
2526

2627
</RefCard>
27-
<RefCard href="/library/api-reference/layout/st.columns">
28+
<RefCard href="/library/api-reference/layout/st.container">
2829

29-
<Image pure alt="screenshot" src="/images/api/columns.jpg" />
30+
<Image pure alt="screenshot" src="/images/api/container.jpg" />
3031

31-
<h4>Columns</h4>
32+
<h4>Container</h4>
3233

33-
Insert containers laid out as side-by-side columns.
34+
Insert a multi-element container.
3435

3536
```python
36-
col1, col2 = st.columns(2)
37-
col1.write("this is column 1")
38-
col2.write("this is column 2")
37+
c = st.container()
38+
st.write("This will show last")
39+
c.write("This will show first")
40+
c.write("This will show second")
3941
```
4042

4143
</RefCard>
42-
<RefCard href="/library/api-reference/layout/st.tabs">
44+
<RefCard href="/library/api-reference/layout/st.empty">
4345

44-
<Image pure alt="screenshot" src="/images/api/tabs.jpg" />
46+
<Image pure alt="screenshot" src="/images/api/empty.jpg" />
4547

46-
<h4>Tabs</h4>
48+
<h4>Empty</h4>
4749

48-
Insert containers separated into tabs.
50+
Insert a single-element container.
4951

5052
```python
51-
tab1, tab2 = st.tabs(["Tab 1", "Tab2"])
52-
tab1.write("this is tab 1")
53-
tab2.write("this is tab 2")
53+
c = st.empty()
54+
st.write("This will show last")
55+
c.write("This will be replaced")
56+
c.write("This will show first")
5457
```
5558

5659
</RefCard>
@@ -68,35 +71,46 @@ with st.expander("Open to see more"):
6871
```
6972

7073
</RefCard>
71-
<RefCard href="/library/api-reference/layout/st.container">
74+
<RefCard href="/library/api-reference/layout/st.popover">
7275

73-
<Image pure alt="screenshot" src="/images/api/container.jpg" />
76+
<Image pure alt="screenshot" src="/images/api/popover.svg" />
7477

75-
<h4>Container</h4>
78+
<h4>Popover</h4>
7679

77-
Insert a multi-element container.
80+
Insert a multi-element popover container that can be opened/closed.
7881

7982
```python
80-
c = st.container()
81-
st.write("This will show last")
82-
c.write("This will show first")
83-
c.write("This will show second")
83+
with st.popover("Settings"):
84+
st.checkbox("Show completed")
8485
```
8586

8687
</RefCard>
87-
<RefCard href="/library/api-reference/layout/st.empty">
88+
<RefCard href="/library/api-reference/layout/st.sidebar">
8889

89-
<Image pure alt="screenshot" src="/images/api/empty.jpg" />
90+
<Image pure alt="screenshot" src="/images/api/sidebar.jpg" />
9091

91-
<h4>Empty</h4>
92+
<h4>Sidebar</h4>
9293

93-
Insert a single-element container.
94+
Display items in a sidebar.
9495

9596
```python
96-
c = st.empty()
97-
st.write("This will show last")
98-
c.write("This will be replaced")
99-
c.write("This will show first")
97+
st.sidebar.write("This lives in the sidebar")
98+
st.sidebar.button("Click me!")
99+
```
100+
101+
</RefCard>
102+
<RefCard href="/library/api-reference/layout/st.tabs">
103+
104+
<Image pure alt="screenshot" src="/images/api/tabs.jpg" />
105+
106+
<h4>Tabs</h4>
107+
108+
Insert containers separated into tabs.
109+
110+
```python
111+
tab1, tab2 = st.tabs(["Tab 1", "Tab2"])
112+
tab1.write("this is tab 1")
113+
tab2.write("this is tab 2")
100114
```
101115

102116
</RefCard>

content/library/api/layout/popover.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: st.popover
3+
slug: /library/api-reference/layout/st.popover
4+
description: st.popover inserts a multi-element popover container
5+
---
6+
7+
<Autofunction function="streamlit.popover" />

content/library/api/testing/st.testing.v1.AppTest.md

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Note that you can also retrieve elements within a specific container in the same
5555

5656
<Autofunction function="AppTest.exception" />
5757

58+
<Autofunction function="AppTest.expander" />
59+
5860
<Autofunction function="AppTest.header" />
5961

6062
<Autofunction function="AppTest.info" />
@@ -87,6 +89,8 @@ Note that you can also retrieve elements within a specific container in the same
8789

8890
<Autofunction function="AppTest.success" />
8991

92+
<Autofunction function="AppTest.status" />
93+
9094
<Autofunction function="AppTest.table" />
9195

9296
<Autofunction function="AppTest.tabs" />

0 commit comments

Comments
 (0)