Skip to content
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

Update FAQ to indicate components can go in the sidebar #2589

Merged
merged 3 commits into from Jan 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/streamlit_faq.md
Expand Up @@ -64,9 +64,19 @@ Below are some selected questions we've received about Streamlit Components. If
- **Can't modify CSS**: A Component can’t modify the CSS that the rest of the Streamlit app uses, so you can't create something like `dark_mode`
- **Can't add/remove elements**: A Component can’t add or remove other elements of a Streamlit app, so you couldn't make something like `remove_streamlit_hamburger_menu`

3. **How do I build a Component that can be displayed in the sidebar?**

Currently, it is not possible to create a component in the sidebar, but we’re hoping to release that functionality in a future release.
3. **How do I add a Component to the sidebar?**

You can add a component to st.sidebar using the `with` syntax. For example:
```
with st.sidebar:
my_component(greeting="hello")
```
In fact, you can add your component to _any_ [layout container](./api.html#lay-out-your-app) (eg st.beta_columns, st.beta_expander), using the `with` syntax!
```
col1, col2 = st.beta_columns(2)
with col2:
my_component(greeting="hello")
```

4. **My Component seems to be blinking/stuttering...how do I fix that?**

Expand Down