Skip to content

Add st.toggle documentation #784

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 3 commits into from
Aug 23, 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
13 changes: 13 additions & 0 deletions content/library/api/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ Display a checkbox widget.
selected = st.checkbox("I agree")
```

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

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

#### Toggle

Display a toggle widget.

```python
activated = st.toggle("Activate")
```

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

Expand Down
7 changes: 7 additions & 0 deletions content/library/api/widgets/toggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: st.toggle
slug: /library/api-reference/widgets/st.toggle
description: st.toggle displays a toggle widget.
---

<Autofunction function="streamlit.toggle" />
13 changes: 13 additions & 0 deletions content/library/api/widgets/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ Display a checkbox widget.
selected = st.checkbox("I agree")
```

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

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

#### Toggle

Display a toggle widget.

```python
activated = st.toggle("Activate")
```

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

Expand Down
3 changes: 3 additions & 0 deletions content/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ site_menu:
- category: Streamlit library / API reference / Input widgets / st.checkbox
url: /library/api-reference/widgets/st.checkbox
isVersioned: true
- category: Streamlit library / API reference / Input widgets / st.toggle
url: /library/api-reference/widgets/st.toggle
isVersioned: true
- category: Streamlit library / API reference / Input widgets / st.radio
url: /library/api-reference/widgets/st.radio
isVersioned: true
Expand Down
Binary file added public/images/api/toggle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading