Skip to main content

MUI X components for Streamlit, built with Components v2. Includes DatePicker, TimePicker, and DateTimePicker.

Project description

st-mui

MUI X components for Streamlit, built with Components v2

PyPI version Downloads Python ≥3.10 License
Open in Streamlit


Components

Component Description Standard Streamlit equivalent
time_picker Clock UI, AM/PM toggle, min/max bounds st.time_input (text field only)
date_time_picker Combined date + time in one widget, AM/PM toggle, calendar popover st.datetime_input (text field only)
date_picker Calendar popover with format control st.date_input

Installation

uv add st-mui

or with pip:

pip install st-mui

Quick start

import streamlit as st
from datetime import time, datetime, date
from st_mui import time_picker, date_time_picker, date_picker

t = time_picker(
    label="Pick a time",
    value=time(9, 30),
    ampm=True,
    key="my_time",
)

dt = date_time_picker(
    label="Select date & time",
    value=datetime.now(),
    key="my_datetime",
)

d = date_picker(
    label="Pick a date",
    value=date.today(),
    key="my_date",
)

API

time_picker

time_picker(
    label="Select a time",
    value=None,           # time object or HH:MM string
    ampm=True,            # 12-hour vs 24-hour
    min_time=None,
    max_time=None,
    disabled=False,
    on_change=None,
    key=None,
) -> time | None

date_time_picker

date_time_picker(
    label="Select date & time",
    value=None,           # datetime object or ISO string
    min_datetime=None,
    max_datetime=None,
    ampm=True,
    disabled=False,
    on_change=None,
    key=None,
) -> datetime | None

date_picker

date_picker(
    label="Select a date",
    value=None,           # date object or YYYY-MM-DD string
    min_date=None,
    max_date=None,
    format="MM/DD/YYYY",  # MUI format tokens
    disabled=False,
    on_change=None,
    key=None,
) -> date | None

Running the example

pip install st-mui
streamlit run examples/showcase.py

Development

# Clone and install
git clone https://github.com/lperezmo/st-mui.git
cd st-mui
uv sync --dev

# Build frontend
cd st_mui/frontend
npm install
npm run build
cd ../..

# Run showcase
uv run streamlit run examples/showcase.py

License

MIT

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

st_mui-0.2.5.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

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

st_mui-0.2.5-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file st_mui-0.2.5.tar.gz.

File metadata

  • Download URL: st_mui-0.2.5.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for st_mui-0.2.5.tar.gz
Algorithm Hash digest
SHA256 8fe7f2f4aea1880485dba905d2979ca438651dfe8dffc09aaf0accfa9fcce7bf
MD5 783624cf0230754d5138ae186454dc06
BLAKE2b-256 40640ccdc64f7698582faf08cdb901fad4d987584001ef2ecc7a3667d7f1d839

See more details on using hashes here.

File details

Details for the file st_mui-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: st_mui-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for st_mui-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cafaa510835549e8c12076821769acb7f486a2ce0b67d2cc1d4afd4f736ac62f
MD5 ead1f9bfd05f70e81be90e0d813f2bed
BLAKE2b-256 e01ab4c4fc3a3e04e443888158617ad905e9565f81a1c8f4b51c8cdd274e7f54

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