Skip to content

Commit

Permalink
Add "enable" toggle to camera_input embedded app (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dmatthews authored Sep 27, 2024
1 parent cae2b3e commit 84b4e49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/api-examples-source/widget.camera_input.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import streamlit as st

picture = st.camera_input("Take a picture")
enable = st.checkbox("Enable camera")
picture = st.camera_input("Take a picture", disabled=not enable)

if picture:
st.image(picture)

0 comments on commit 84b4e49

Please sign in to comment.