Skip to main content

Streamlit component that allows you to display a calendar on which users can select a date.

Project description

📅 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

# Define available dates (e.g. from your backend, bookings, etc.)
available_dates = [
    datetime.date(2025, 6, 20),
    datetime.date(2025, 6, 25),
    datetime.date(2025, 7, 2),
]

# Call the calendar input
selected_date = calendar_input(available_dates)

# Display the selected date
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

# Clone the repo
git clone https://github.com/yourusername/streamlit-calendar-input.git
cd streamlit-calendar-input

# (Optional) Create a virtual environment
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows

# Install dependencies
pip install -e .

📝 License

MIT License. See LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_calendar_input-0.0.1.tar.gz (126.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_calendar_input-0.0.1-py3-none-any.whl (125.9 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_calendar_input-0.0.1.tar.gz.

File metadata

  • Download URL: streamlit_calendar_input-0.0.1.tar.gz
  • Upload date:
  • Size: 126.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for streamlit_calendar_input-0.0.1.tar.gz
Algorithm Hash digest
SHA256 970d951832c6fd2c9e9a9f42644a3f7ab6543f914b7143ead0950ae141739245
MD5 7618bdd659e0693d1d5f17614d98f721
BLAKE2b-256 be893abc75fda0977860fb8d4e63f9a036a2ab88563e2851988c658bfbeab023

See more details on using hashes here.

File details

Details for the file streamlit_calendar_input-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_calendar_input-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11e0dd85cad8a38e4a6612554ddc09c2ba5804f3176b4caa5b5ab1d36766139a
MD5 117fea25808cc75514843ae9f74918ca
BLAKE2b-256 ae974850f7028d55b45565b13adeb2c787279ab7e3d8c56987f4e52f2f4b7b50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page