[Question] Valign?

It is probably staring me in the face but I’ll ask anyway… Is there a valign property in a label style? I do not see it.

Never mind… It was looking right at me!! How do I delete this?!

Don’t. Let other poor souls see this when they want to ask the same question. (-:

5 Likes

For posterity, yes, the Label component has a property called alignVertical that will accept any of these values:
"top", "center", or "bottom"

1 Like

My problem was I expected it to be in the style with everything else.

Yeah, I agree, that is a very logical expectation. You probably wouldn’t believe what kind of spirited discussion we’ve had around the topic of vertical alignment, which is a notoriously difficult thing to do on the web, believe it or not.

The reason that the property doesn’t exist in “style” is that the “style” object is a direct inline css stylesheet, and no such property exists in css to align vertically. We think this is silly, and so we implemented a vertical alignment ourselves using an internal flex layout for the label component, but we felt it would be a poor fit for the style object, as it would be a bizarre exception to the rule of how that object is interpreted.

2 Likes

old thread, but I wanted to let you know that updating from 8.0.10 to 8.0.14 caused every label that was alignVertical = top (the default in 8.0.10 when you drop in a label) to alignVertical = center (the default in 8.0.14). Talk about a mess to clean up…