Skip to main content

Streamlit component that allows you to do X

Project description

streamlit-custom-component

Streamlit component that allows you to do X

Installation instructions

pip install streamlit-custom-component

Usage instructions

import streamlit as st

from my_component import my_component

value = my_component()

st.write(value)

Local development

  1. Start Streamlit from the project root:

    streamlit run my_component/example.py
    
  2. In another terminal, run the Vite dev server from my_component/frontend:

    npm install
    npm run start
    

Important dev server notes

  • The browser connects to the Vite dev server directly. Streamlit does not proxy this port, so the Vite port must be reachable from the client just like the Streamlit port.
  • Vite listens on the value of VITE_PORT (default 3001). This variable lives in my_component/frontend/.env. Update that file whenever you need to change the port, and remember that Windows/WSL/Hyper-V or dev containers may silently remap addresses like 3001.
  • If a port is unavailable or blocked by a firewall/mobile connection, set VITE_PORT=5173 (Vite's default) or any other open port inside the .env file before running npm run start, and ensure that port is reachable from your browser.

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_custom_component-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

st_custom_component-0.0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for st_custom_component-0.0.1.tar.gz
Algorithm Hash digest
SHA256 89f1e0194b028687c536759961ff1e57f752163a438440497f0e196cc1fb8855
MD5 d6496ac79e934b1fbd64b80b9cc548d5
BLAKE2b-256 1353b14d62e7bf9bb806720424e8db6181c2462a246dbfccea6632679195c582

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for st_custom_component-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4354cfe75200c9926a8c13ee9212e0ffeefa000c4cefe54319310a5e806bcb49
MD5 a829cc2b9f08c6a6ab7e872b658ad774
BLAKE2b-256 e066c9fc3b9b2938e38d81dda2fcb12cf12270dba797d9d243254e6f623ce339

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