question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `id` parameter to st.container (and other objects)

See original GitHub issue

Problem

I would like to be able to style containers or elements without hacking with nth-child(). This would be easier if it were possible to reference the container by id instead of using the generated css class.

Solution

Looking at the layouts.py code, this is non-trivial. Ideally each object would have an id member, which then gets rendered out to the react component as an attribute.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

6reactions
Qualzzcommented, Sep 23, 2022

Targeting any specific element with css ID & classes would be HUGE. It would allow us to add custom responsive grids, hovering effects, using frameworks like bootstraps, better customisation for any elements inside a particular container. etc.

st.component_name( class=“myclass my2ndclass” id=“myID” ) would help a lot and solve most of the headaches about unreliable css hacking/creating custom component just for it etc.

0reactions
jriekecommented, Oct 7, 2022

Just realized this is a duplicate of #3888. Closing since the other issue is older and has more upvotes. Will look at the comments in here when we work on it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

st.container - Streamlit Docs
To add elements to the returned container, you can use "with" notation (preferred) or just call methods directly on the returned object. See...
Read more >
Store configuration data using Docker Configs
Docker swarm service configs allow you to store non-sensitive information, such as configuration files, outside a service's image or running containers.
Read more >
Create a user delegation SAS - Azure Storage - Microsoft Learn
Specifies the object ID for an Azure AD security principal that's authorized by the owner of the user delegation key to perform the...
Read more >
121 Blueprint Container Specification - OSGi Compendium 7
Bean Manager - A manager that has metadata for creating Java objects and injecting them with objects and component instances that come from...
Read more >
FeatureLayer | API Reference - ArcGIS Developers
Name Type Class apiKey String FeatureLayer blendMode String FeatureLayer capabilities Object FeatureLayer
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found