Skip to content

Make titles/headers align better in horizontal container #12434

@jrieke

Description

@jrieke

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

Due to the padding above/below titles and headers, they don't align well with other elements if used in a horizontal container:

import streamlit as st

with st.container(horizontal=True, vertical_alignment="center"):
    st.title("This is a title")
    st.button("This is not aligned")
Image

Would be great to improve that!

Why?

Looks better if it's aligned.

How?

Maybe we automatically get rid of the padding above/below if used in a horizontal container? Or some other solution?

Additional Context

No response

Metadata

Metadata

Assignees

Labels

area:layoutRelated to layout and positioningfeature:st.containerRelated to the `st.container` elementfeature:st.headerRelated to the `st.header` elementfeature:st.titleRelated to the `st.title` elementtype:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions