A lightning:layout is a flexible grid system for arranging containers within a page or inside another container. The default layout is mobile-first and can be easily configured on different devices.
Lightning:layout is simplify to write HTML tag code.It is basically a <div class=”slds-grid”></div>.
Lightning:layout can be customized by using different attribute values:
It determines how to spread the layoutItems horizontally.It has four values:
Here is the code:
Here is the design:
verticalAlign
It determines how to spread the layout Items vertically. It has four values:
Here is the code:
Here is the design:
pullToBoundary
If padding is used on layout Items, this attribute pulls the element on either side of the container to the boundary by giving margin.Choose the size that corresponds to the size on layout Items. It has three value:
multipleRows
It determines whether the child element is wrap or not when they exceed the layout width.If it is true, then items wrap to the following line. Its default value is false.
A lightning:layoutItem is the basic element within lightning:layout. We can arrange one or more lightning:layoutItem. It enables how to configure the lightning:layoutItems size on different device sizes.
Lightning:layoutItems can be customized by using the different attribute values:
Note: If the smallDeviceSize, mediumDeviceSize and largeDeviceSize attributes are specified, the size attribute is required.
If the viewport is divided into 12 parts, this deviceSize attributes indicate the relative space of the container occupies. It is expressed as an integer from 1 through 12.
Here is the code:
Here is the design:
It makes the item flexy so that it absorbs any extra space in its container or shrinks when there is less space. It has six values;
Example:
Here is the code:
Here is the design:
These attribute force the layoutItem to alignment with bump.It has four values:
Example:
Here is the code:
Here is the design:
It sets the padding either left or right side of the layoutItem. It has six values:
Example:
Here is the code
Here is the design:
To know more about the lightning:layout and lightning:layoutItem refer to
https://developer.salesforce.com/docs/component-library/bundle/lightning:layout/example
https://developer.salesforce.com/docs/component-library/bundle/lightning:layoutItem/example