import streamlit as st def carousel (documents): index = 0 with st.container(): st.title(f'Document {index + 1} / {len(documents)}') if st.button("⬅️") and index > 0: index -= 1 if st.button("➡️") and index < len(documents) - 1: index += 1 st.json(documents[index])