📅 Streamlit Calendar Input
A custom Streamlit calendar widget that lets users select dates from a list of available options. Dates are shown month-by-month, with green marking available days and red marking unavailable ones.
🔧 Features
- 📆 Interactive calendar input widget for Streamlit
- ✅ Green: Available dates
- ❌ Red: Unavailable dates
- 🖱️ Click to select a date
- 🔄 Returns a Python
datetime.date object
📦 Installation
pip install streamlit-calendar-input
🚀 Usage
import streamlit as st
from streamlit_calendar_input import calendar_input
import datetime
available_dates = [
datetime.date(2025, 6, 20),
datetime.date(2025, 6, 25),
datetime.date(2025, 7, 2),
]
selected_date = calendar_input(available_dates)
if selected_date:
st.success(f"You selected: {selected_date}")
🧠 How it Works
-
The widget renders a calendar month by month.
-
Each day is color-coded:
- ✅ Green: Clickable, available in
available_dates
- ❌ Red: Not clickable, unavailable
-
When a user clicks a green date, the widget returns the corresponding datetime.date object.
📌 Requirements
🧪 Development
git clone https://github.com/yourusername/streamlit-calendar-input.git
cd streamlit-calendar-input
python -m venv venv
source venv/bin/activate
pip install -e .
📝 License
MIT License. See LICENSE for more details.