File size: 1,484 Bytes
f5e40dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | import streamlit as st
st.title('Unit 5. Layouts & Containers')
st.caption('์ฐธ์กฐ์ฌ์ดํธ: https://docs.streamlit.io/library/api-reference/layout')
# sidebar- with ์ฌ์ฉํ๊ธฐ ๐ง ๐ฑ ๐
with st.sidebar:
st.header('1. Sidebar')
add_selectbox = st.sidebar.selectbox('์ด๋ป๊ฒ ์ฐ๋ฝ๋๋ฆด๊น์?',
('Email', 'Mobile', 'Ofice Phone')
)
if add_selectbox == 'Email':
st.sidebar.title('๐ง')
elif add_selectbox == 'Mobile':
st.sidebar.title('๐ฑ')
elif add_selectbox == 'Ofice Phone':
st.sidebar.title('๐')
# columns
Cat = 'https://images.pexels.com/photos/2071873/pexels-photo-2071873.jpeg?auto=compress&cs=tinysrgb'
Dog = 'https://images.pexels.com/photos/3361739/pexels-photo-3361739.jpeg?auto=compress&cs=tinysrgb'
Owl = 'https://images.pexels.com/photos/3737300/pexels-photo-3737300.jpeg?auto=compress&cs=tinysrgb'
st.header('2. Columns')
col1, col2, col3 = st.columns(3)
with col1:
st.text('Cat')
st.image(Cat)
with col2:
st.text('Dog')
st.image(Dog)
with col3:
st.text('Owl')
st.image(Owl)
# # tabs - width=200
st.header('3. Tabs')
tab1, tab2, tab3 = st.tabs(['Cat', 'Dog', 'Owl'])
with tab1:
st.text('Cat')
st.image(Cat, caption='This is a cat', width=300)
with tab2:
st.text('Dog')
st.image(Dog, caption='This is a dog', width=300)
with tab3:
st.text('Owl')
st.image(Owl, caption='This is an owl', width=300) |