
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
st-image-carousel
Advanced tools
Un composant Streamlit personnalisé pour créer des carrousels d'images interactifs et modernes avec navigation infinie et personnalisation complÚte.
result = image_carousel(
images=images,
key="basic_carousel"
)
result = image_carousel(
images=images,
max_visible=7,
key="large_carousel"
)
result = image_carousel(
images=images,
orientation="vertical",
max_visible=5,
key="vertical_carousel"
)
result = image_carousel(
images=images,
max_visible=5,
background_color="#0f0f23",
active_border_color="#00ff88",
active_glow_color="rgba(0, 255, 136, 0.6)",
fallback_background="#1a1a2e",
fallback_gradient_end="#0a0a1a",
text_color="#ffffff",
arrow_color="#00ff88",
key="dark_theme"
)
result = image_carousel(
images=images,
max_visible=5,
background_color="#f8fafc",
active_border_color="#3b82f6",
active_glow_color="rgba(59, 130, 246, 0.5)",
fallback_background="#e2e8f0",
fallback_gradient_end="#cbd5e1",
text_color="#1e293b",
arrow_color="#3b82f6",
key="light_theme"
)
result = image_carousel(
images=images,
selected_image="Lionel Messi", # Image centrée au démarrage
background_color="#1e3a8a",
active_border_color="#fbbf24",
active_glow_color="rgba(251, 191, 36, 0.7)",
text_color="#ffffff",
key="preselected"
)
| ParamÚtre | Type | Défaut | Description |
|---|---|---|---|
images | list | Requis | Liste des images [{"name": "nom", "url": "url"}, ...] |
selected_image | str | None | Nom de l'image à centrer au démarrage |
max_visible | int | 5 | Nombre d'images visibles simultanément |
orientation | str | "horizontal" | Orientation : "horizontal" ou "vertical" |
background_color | str | "#1a1a2e" | Couleur de fond du composant |
active_border_color | str | "#ffffff" | Couleur de bordure de l'image active |
active_glow_color | str | "rgba(255, 255, 255, 0.5)" | Couleur de l'effet de lueur |
fallback_background | str | "#2a2a3e" | Couleur de fond des images en chargement |
fallback_gradient_end | str | "rgb(0, 0, 0)" | Couleur de fin du gradient de fallback |
text_color | str | "#ffffff" | Couleur du texte des noms |
arrow_color | str | "#ffffff" | Couleur des flĂšches de navigation |
key | str | None | Clé unique pour Streamlit |
images = [
{
"name": "Nom affiché", # Requis : texte sous l'image
"url": "https://example.com/..." # Requis : URL ou Base64
},
# ... autres images
]
Le composant retourne un dictionnaire :
{
"selected_image": "Nom de l'image", # Nom de l'image sélectionnée
"selected_url": "URL de l'image", # URL de l'image sélectionnée
"current_index": 2 # Index de l'image (0-based)
}
import streamlit as st
from st_image_carousel import image_carousel
# Images de joueurs
players = [
{"name": "Lionel Messi", "url": "https://example.com/messi.jpg"},
{"name": "Cristiano Ronaldo", "url": "https://example.com/ronaldo.jpg"},
# ... autres joueurs
]
# Barre de recherche
search = st.text_input("đ Rechercher un joueur")
# Filtrer les résultats
if search:
filtered_players = [p for p in players if search.lower() in p["name"].lower()]
if filtered_players:
st.success(f"â
{len(filtered_players)} joueur(s) trouvé(s)")
else:
st.warning("â Aucun joueur trouvĂ©")
filtered_players = players
else:
filtered_players = players
# Carrousel avec résultats
result = image_carousel(
images=filtered_players,
max_visible=5,
key="search_carousel"
)
# Afficher les informations
if result:
st.success(f"Joueur sélectionné : {result['selected_image']}")
st.image(result['selected_url'], width=200)
import base64
def image_to_base64(image_path):
with open(image_path, "rb") as file:
return f"data:image/jpeg;base64,{base64.b64encode(file.read()).decode()}"
images = [
{
"name": "Image locale",
"url": image_to_base64("path/to/image.jpg")
}
]
col1, col2 = st.columns(2)
with col1:
st.subheader("đ Horizontal")
result_h = image_carousel(
images=images,
orientation="horizontal",
max_visible=5,
key="horizontal"
)
with col2:
st.subheader("đ Vertical")
result_v = image_carousel(
images=images,
orientation="vertical",
max_visible=5,
key="vertical"
)
gaming_theme = {
"background_color": "#0f0f23",
"active_border_color": "#00ff88",
"active_glow_color": "rgba(0, 255, 136, 0.6)",
"fallback_background": "#1a1a2e",
"fallback_gradient_end": "#0a0a1a",
"text_color": "#ffffff",
"arrow_color": "#00ff88"
}
business_theme = {
"background_color": "#f8fafc",
"active_border_color": "#3b82f6",
"active_glow_color": "rgba(59, 130, 246, 0.5)",
"fallback_background": "#e2e8f0",
"fallback_gradient_end": "#cbd5e1",
"text_color": "#1e293b",
"arrow_color": "#3b82f6"
}
sport_theme = {
"background_color": "#1e3a8a",
"active_border_color": "#fbbf24",
"active_glow_color": "rgba(251, 191, 36, 0.7)",
"fallback_background": "#3b82f6",
"fallback_gradient_end": "#1e40af",
"text_color": "#ffffff",
"arrow_color": "#fbbf24"
}
FAQs
Un composant Streamlit pour afficher un carrousel d'images
We found that st-image-carousel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: whatâs affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.