Skip to content

Aligning content in slides view #9856

Closed

Description

@rzimmerdev

Description

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

Image > Slide view Image > Cell view (see how it is not vertically aligned by default?)

Activity

  1. rzimmerdev commented on Jun 11, 2026

    @rzimmerdev
    Author

    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.

  2. Light2Dark commented on Jun 11, 2026

    @Light2Dark
    Member

    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?

  3. rzimmerdev commented on Jun 11, 2026

    @rzimmerdev
    Author

    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.

  4. rehan243 commented on Jun 13, 2026

    @rehan243

    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.

  5. rzimmerdev commented on Jun 13, 2026

    @rzimmerdev
    Author

    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.

  6. added a commit that references this issue on Jul 14, 2026
    101ee41
  7. added a commit that references this issue on Sep 6, 2026
    963296d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions