You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In slides view, content is vertically aligned to the center of the view, instead of to the top as in the normal cell view.
I believe it would be interesting to allow the slide view to specify where to align content, or instead default to top alignment so it correctly replicates the view that is shown in cell mode, so the user can decide if they want to align the content or not using vstack or some other layout component.
Are you willing to submit a PR? (You must receive approval from the team before submitting a PR.)
Yes
Alternatives
I tried putting the entire slide content in a vstack, but vstack only covers where it's content fills, so it can't align vertically unless the view fills the screen completely (at which point its the same as center align)
Additional context
> Slide view
> Cell view (see how it is not vertically aligned by default?)
obs: I ask this because more often than not slides will have headers/footers that will have to remain at top/bottom of the screen, or similar. If we align ALL content vertically to the center, the position of the headers/footers depend on the size of the content, and change where they are shown on the screen every slide. This makes for a very unpleasant presentation experience.
I think the slide alignment should be global, as the alignment per-slide should rather be achieved by correctly crafting the elements/whatever the user wants to show in the given slide.
If I want to center something I could use html or something else.
Oh, quick question — when you're testing this, are you setting the slide view frame explicitly or is it just inheriting the parent dimensions? Sometimes the alignment will act weird if the frame isn't constrained properly.
Anyway, yeah, ran into something similar with a VStack not stretching to fill the parent view. A trick that worked for us was using a Spacer() above the content inside the VStack to push it down when you want the alignment to go to the top. Here's a rough idea:
VStack{Spacer() // pushes the content down
Text("Your content here")}.frame(maxWidth:.infinity, maxHeight:.infinity, alignment:.top)
That .frame call is key 'cause it forces the view to take up all space, even when the content doesn't. But if your parent view's dimensions aren't full-screen, this won't behave as you'd expect — that's why I asked about your setup.
Also, are you thinking of adding this as a toggle in the UI or just a global config option? Curious how you're imagining users interacting with it.
I don't really know Swift so I can't really give an opinion on how I would write something in Swift for my slides, as I just use the normal python setup. Since I believe that the correct approach would have the default be top-left aligned (as is for normal HTML text, and would thus be closer to WYSIWYG), I don't see why a toggle in the UI would make sense.
If the option is be added to switch from top aligned to center aligned (vertically), it would be a backwards compatibility option and should thus be a global config.
Activity
rzimmerdev commentedon Jun 11, 2026
obs: I ask this because more often than not slides will have headers/footers that will have to remain at top/bottom of the screen, or similar. If we align ALL content vertically to the center, the position of the headers/footers depend on the size of the content, and change where they are shown on the screen every slide. This makes for a very unpleasant presentation experience.
Light2Dark commentedon Jun 11, 2026
That makes sense, I think vertically aligning was a convenience thing, most users tend to want everything centered.
If we did make it configurable, would it be global for all slides?
rzimmerdev commentedon Jun 11, 2026
I think the slide alignment should be global, as the alignment per-slide should rather be achieved by correctly crafting the elements/whatever the user wants to show in the given slide.
If I want to center something I could use html or something else.
rehan243 commentedon Jun 13, 2026
Oh, quick question — when you're testing this, are you setting the slide view frame explicitly or is it just inheriting the parent dimensions? Sometimes the alignment will act weird if the frame isn't constrained properly.
Anyway, yeah, ran into something similar with a
VStacknot stretching to fill the parent view. A trick that worked for us was using aSpacer()above the content inside theVStackto push it down when you want the alignment to go to the top. Here's a rough idea:That
.framecall is key 'cause it forces the view to take up all space, even when the content doesn't. But if your parent view's dimensions aren't full-screen, this won't behave as you'd expect — that's why I asked about your setup.Also, are you thinking of adding this as a toggle in the UI or just a global config option? Curious how you're imagining users interacting with it.
rzimmerdev commentedon Jun 13, 2026
I don't really know Swift so I can't really give an opinion on how I would write something in Swift for my slides, as I just use the normal python setup. Since I believe that the correct approach would have the default be top-left aligned (as is for normal HTML text, and would thus be closer to WYSIWYG), I don't see why a toggle in the UI would make sense.
If the option is be added to switch from top aligned to center aligned (vertically), it would be a backwards compatibility option and should thus be a global config.
feat(slides): add deck-level content alignment control (marimo-team#1…
feat(slides): add deck-level content alignment control (marimo-team#1…