Getting started
Resources
Flex
Spacing
Layout
Size
Typography
Background
Border
Transition
Utility classes for changing an element's align self property. Align self affects the alignment of this element along the cross axis separately from the parent's align items property.
Main and cross axes change depending on an element's current flex direction, which affects the behaviour of it's flex properties. By default, elements have a flex direction of column meaning the main axis start is at the top, and main axis end is at the bottom of the element. Self alignment will adjust the alignment and spacing of this element along the cross axis (horizontal).
Classes for align self are named using the format: [self]-[value]
.
Where value includes:
auto
- for align-self: auto
start
- for align-self: flex-start
center
- for align-self: center
end
- for align-self: flex-end
stretch
- for align-self: stretch
Class | Contents |
|
|
|
|
|
|
|
|
|
|
Note that align-self: auto
is the default value for align self in Unity. Unless the value needs to be overridden from a parent, the self-auto
class is not needed.
With self-auto
, this element is aligned along the cross axis as defined by the parent container's align items property.
UXML
With self-start
, this element is aligned to start at the parent's cross axis start, and progress to the cross axis end.
UXML
With self-center
, this element is aligned to be centered on the parent's cross axis.
UXML
With self-end
, this element is aligned to start at the parent's cross axis end, and progress to cross axis start.
UXML
With self-stretch
, this element is aligned to stretch along the parent's cross axis.
UXML
On this page