Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support some streamlit configuration (at least Theming) #997

Closed
Abdelgha-4 opened this issue Jun 26, 2024 · 3 comments · Fixed by #1010
Closed

Feature Request: support some streamlit configuration (at least Theming) #997

Abdelgha-4 opened this issue Jun 26, 2024 · 3 comments · Fixed by #1010

Comments

@Abdelgha-4
Copy link

Hello,

Streamlit apps may have a config.toml that offers many options for customization and finer control over the app. I think that supporting at least some of the options would be a convenient and useful feature.

For example this is the configuration I was using on a Streamlit app, but when moving to stlite I found no way to apply the same config.

[theme]
primaryColor ="#E51E2B"
secondaryBackgroundColor = "#F5F5F5"

[client]
toolbarMode = "minimal"
showErrorDetails = false

[runner]
magicEnabled = false
fastReruns = true
enforceSerializableSessionState = true
@whitphx
Copy link
Owner

whitphx commented Jul 8, 2024

If you are using @stlite/mountable, the streamlitConfig option of stlite.mount() is for that purpose as below.
You can pass the key-value pairs of the configs.
Unlike config.toml, the keys are not nested, but period-separated values like theme.primaryColor.

stlite.mount(
  {
    // Other options...
    streamlitConfig: {
        "theme.primaryColor": "#E51E2B",
        "theme.backgroundColor": "#FFFFFF",
        "theme.secondaryBackgroundColor": "#262730",
        "theme.textColor": "#fafafa",
        "theme.font": "sans serif",
    },
  },
  document.getElementById("app")
);

In stlite sharing or @stlite/desktop, this feature is not available yet.

@Abdelgha-4
Copy link
Author

Thanks! That's exactly what I wanted. I didn't find any reference or documentation about streamlitConfig.
Please feel free to close the issue if it's documented.

@whitphx
Copy link
Owner

whitphx commented Jul 10, 2024

Sorry I hadn't documented it yet, and did in #1010 . Will close this issue when it's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants