Does Streamlit have any components like Dash DAQ?

Looking for “engineering” components that mimic physical, tactile controls like Dash DAQ, LabVIEW, or MATLAB - LEDs, knobs, etc.

Here’s a Dash DAQ style that my boss would like me to recreate in Streamlit:

You can do this by using only streamlit, no need for components, and unfortunately, the UI will not be the same.
To get the same UI you need to be familiar with react components and how to build them for streamlit.
Giselle
Example :

Your question is interesting: The component as you present it doesn’t have an equivalent in Streamlit; it is a small DASH application.

In both DASH and Streamlit applications, there is interactivity: the widget is a JavaScript/HTML component that not only needs to display something appealing and ergonomic but also provide a result to the calling Python application.

In the case of Streamlit, the component’s JavaScript code uses the Streamlit.setComponentValue(…) instruction to communicate the component’s value to the Python part. In the case of Dash, I haven’t looked into it, but I imagine a similar behavior through the callback mechanism.

If your Dash component does not need to return a value to the Python application, you can consider an approach like this:

python

Copier le code

import streamlit as st
st.title("Streamlit App with Embedded Dash")
dash_url = "http://127.0.0.1:8050"
st.components.v1.iframe(src=dash_url, width=700, height=600, scrolling=True)

The constraint is to have a DASH server in addition to the Streamlit server.

However, if you need interactivity in the sense that you need to receive information from the component in Python, I’m afraid the only solution is to recode the component in React.

That said, creating a Streamlit component in React using antd or Material UI is quite simple, and if you wish, I can provide examples. But it does require at least some JavaScript skills.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.