Skip to content

Feature/st.link button #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions content/library/api-cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,24 +192,25 @@ st.experimental_rerun()
#### Display interactive widgets

```python
st.button('Click me')
st.data_editor('Edit data', data)
st.checkbox('I agree')
st.toggle('Enable')
st.radio('Pick one', ['cats', 'dogs'])
st.selectbox('Pick one', ['cats', 'dogs'])
st.multiselect('Buy', ['milk', 'apples', 'potatoes'])
st.slider('Pick a number', 0, 100)
st.select_slider('Pick a size', ['S', 'M', 'L'])
st.text_input('First name')
st.number_input('Pick a number', 0, 10)
st.text_area('Text to translate')
st.date_input('Your birthday')
st.time_input('Meeting time')
st.file_uploader('Upload a CSV')
st.download_button('Download file', data)
st.button("Click me")
st.download_button("Download file", data)
st.link_button("Go to gallery", url)
st.data_editor("Edit data", data)
st.checkbox("I agree")
st.toggle("Enable")
st.radio("Pick one", ["cats", "dogs"])
st.selectbox("Pick one", ["cats", "dogs"])
st.multiselect("Buy", ["milk", "apples", "potatoes"])
st.slider("Pick a number", 0, 100)
st.select_slider("Pick a size", ["S", "M", "L"])
st.text_input("First name")
st.number_input("Pick a number", 0, 10)
st.text_area("Text to translate")
st.date_input("Your birthday")
st.time_input("Meeting time")
st.file_uploader("Upload a CSV")
st.camera_input("Take a picture")
st.color_picker('Pick a color')
st.color_picker("Pick a color")

# Use widgets' returned values in variables:
>>> for i in range(int(st.number_input('Num:'))):
Expand Down
17 changes: 15 additions & 2 deletions content/library/api/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ st.altair_chart(chart, use_container_width=True)
<TileContainer>
<RefCard href="/library/api-reference/widgets/st.button">

<Image pure alt="screenshot" src="/images/api/button.jpg" />
<Image pure alt="screenshot" src="/images/api/button.svg" />

#### Button

Expand All @@ -732,7 +732,7 @@ edited = st.experimental_data_editor(df, num_rows="dynamic")
</RefCard>
<RefCard href="/library/api-reference/widgets/st.download_button">

<Image pure alt="screenshot" src="/images/api/download_button.jpg" />
<Image pure alt="screenshot" src="/images/api/download_button.svg" />

#### Download button

Expand All @@ -742,6 +742,19 @@ Display a download button widget.
st.download_button("Download file", file)
```

</RefCard>
<RefCard href="/library/api-reference/widgets/st.link_button">

<Image pure alt="screenshot" src="/images/api/link_button.svg" />

#### Link button

Display a link button.

```python
st.link_button("Go to gallery", url)
```

</RefCard>
<RefCard href="/library/api-reference/widgets/st.checkbox">

Expand Down
6 changes: 6 additions & 0 deletions content/library/api/widgets/link_button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: st.button
slug: /library/api-reference/widgets/st.link_button
---

<Autofunction function="streamlit.link_button" />
19 changes: 17 additions & 2 deletions content/library/api/widgets/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ With widgets, Streamlit allows you to bake interactivity directly into your apps
<TileContainer>
<RefCard href="/library/api-reference/widgets/st.button">

<Image pure alt="screenshot" src="/images/api/button.jpg" />
<Image pure alt="screenshot" src="/images/api/button.svg" />

#### Button

Expand All @@ -24,7 +24,7 @@ clicked = st.button("Click me")

<RefCard href="/library/api-reference/widgets/st.download_button">

<Image pure alt="screenshot" src="/images/api/download_button.jpg" />
<Image pure alt="screenshot" src="/images/api/download_button.svg" />

#### Download button

Expand All @@ -35,6 +35,21 @@ st.download_button("Download file", file)
```

</RefCard>

<RefCard href="/library/api-reference/widgets/st.link_button">

<Image pure alt="screenshot" src="/images/api/link_button.svg" />

#### Link button

Display a link button.

```python
st.link_button("Go to gallery", url)
```

</RefCard>

<RefCard href="/library/api-reference/widgets/st.checkbox">

<Image pure alt="screenshot" src="/images/api/checkbox.jpg" />
Expand Down
3 changes: 3 additions & 0 deletions content/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ site_menu:
- category: Streamlit library / API reference / Input widgets / st.download_button
url: /library/api-reference/widgets/st.download_button
isVersioned: true
- category: Streamlit library / API reference / Input widgets / st.link_button
url: /library/api-reference/widgets/st.link_button
isVersioned: true
- category: Streamlit library / API reference / Input widgets / st.checkbox
url: /library/api-reference/widgets/st.checkbox
isVersioned: true
Expand Down
Binary file removed public/images/api/button.jpg
Binary file not shown.
20 changes: 20 additions & 0 deletions public/images/api/button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/api/download_button.jpg
Binary file not shown.
Loading