Skip to content

Vue 3 template, that uses Vite, for creating Streamlit Components.

License

Notifications You must be signed in to change notification settings

gabrieltempass/streamlit-component-vue-vite-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit Component Vue Vite Template

A template for creating Streamlit Components. It uses Vue 3 to code the frontend and Vite to serve the files locally during development, as well as bundle and compile them for production.

This repo contains templates and example code for creating Streamlit Components. For complete information, please see the Streamlit Components documentation!

Quickstart

Ensure you have Python 3.6+, Node.js and npm installed.

  1. Clone this repository:
git clone git@github.com:gabrieltempass/streamlit-component-vue-vite-template.git
  1. Go to the frontend directory and initialize and run the component template frontend:
cd streamlit-component-vue-vite-template/my_component/frontend
npm install
npm run dev
  1. From a separate terminal, go to the repository root directory, create a new Python virtual environment, activate it and install Streamlit and the template as an editable package:
cd streamlit-component-vue-vite-template
python3 -m venv venv
. venv/bin/activate
pip install streamlit
pip install -e .

Still from the same separate terminal, run the example Streamlit app:

streamlit run my_component/example.py

If all goes well, you should see something like this:

Quickstart Success

Modify the frontend code at my_component/frontend/src/MyComponent.vue. Modify the Python code at my_component/__init__.py.

References

This template is based on:

About

Vue 3 template, that uses Vite, for creating Streamlit Components.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published