Skip to content

Instantly share code, notes, and snippets.

@hansthen
Created June 15, 2025 23:29
Show Gist options
  • Save hansthen/8986bfafc3f3bc70c949a6e1672d38a0 to your computer and use it in GitHub Desktop.
Save hansthen/8986bfafc3f3bc70c949a6e1672d38a0 to your computer and use it in GitHub Desktop.
import streamlit as st
from streamlit_template import Template
st.set_page_config(
layout="wide"
)
style = """
.card {
/* Add shadows to create the "card" effect */
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: all 0.2s ease;
background-color: #ffb6c1;
border-radius: 15px;
}
/* On mouse-over, add a deeper shadow */
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
.card:active {
transform: scale(.98);
}
/* Add some padding inside the card container */
.container {
padding: 2px 16px;
}
"""
template = Template("""
<div class="card">
<div class="container">
<h4><b>{{name}}</b></h4>
<dl>
<dt>Job Title</dt>
<dd>{{job}}</dd>
<dt>Birthday</dt>
<dd>{{birthday}}</dd>
<dt>Residence</dt>
<dd>{{residence}}</dd>
</dl>
</div>
</div>
""", style=style)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment