File size: 3,123 Bytes
b91146d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46d40d0
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import streamlit as st
from streamlit_option_menu import option_menu


# Page Configuration
st.set_page_config(page_title="Enhanced Navigation Demo", layout="wide")

# Top Navigation Bar using option_menu
selected = option_menu(
    menu_title=None,
    options=["Home", "Documentation", "Examples", "Community", "About"],
    icons=["house", "book", "code", "people", "info-circle"],
    menu_icon="cast",
    default_index=0,
    orientation="horizontal",
    styles={
        "container": {"padding": "0!important", "background-color": "#fafafa"},
        "icon": {"color": "orange", "font-size": "25px"}, 
        "nav-link": {
            "font-size": "15px",
            "text-align": "center",
            "margin":"0px",
            "--hover-color": "#eee",
        },
        "nav-link-selected": {"background-color": "#0083B8"},
    }
)

# Sidebar Navigation
with st.sidebar:
    st.header("Navigation Menu")
    
    # Main Menu Items
    selected_side = option_menu(
        menu_title="Go to",
        options=["Dashboard", "Analytics", "Reports", "Settings"],
        icons=["speedometer2", "graph-up", "file-text", "gear"],
        menu_icon="list",
        default_index=0,
    )
    
    # Expandable Reports Section
    if selected_side == "Reports":
        with st.expander("Reports", expanded=True):
            st.button("Weekly Report")
            st.button("Monthly Report")
            st.button("Annual Report")

# Main Content Area based on top navigation
if selected == "Home":
    st.title("Welcome to Home")
    st.write("This is the home page content.")
    
    # Dashboard Content
    st.header("Dashboard")
    col1, col2, col3 = st.columns(3)
    with col1:
        st.metric("Sales", "$12,345", "+2.5%")
    with col2:
        st.metric("Users", "1,234", "-8%")
    with col3:
        st.metric("Conversion", "3.2%", "+1.2%")

elif selected == "Documentation":
    st.title("Documentation")
    st.write("Documentation content goes here.")
    
elif selected == "Examples":
    st.title("Examples")
    st.write("Example content goes here.")
    
elif selected == "Community":
    st.title("Community")
    st.write("Community content goes here.")
    
elif selected == "About":
    st.title("About")
    st.write("About content goes here.")

# Content based on sidebar selection
if selected_side == "Analytics":
    st.header("Analytics")
    st.line_chart({"data": [1, 5, 2, 6, 2, 1]})
elif selected_side == "Settings":
    st.header("Settings")
    st.toggle("Dark Mode")
    st.toggle("Notifications")
    st.slider("Volume", 0, 100, 50)

# Footer
st.markdown(
    """

    <style>

    .footer {

        position: fixed;

        left: 0;

        bottom: 0;

        width: 100%;

        background-color: #0E1117;

        color: white;

        text-align: center;

        padding: 10px;

        font-size: 14px;

    }

    </style>

    <div class='footer'>

        © 2024 Your App Name • Privacy Policy • Terms of Service

    </div>

    """,
    unsafe_allow_html=True
)