Activity Forums Salesforce® Discussions How to embed multiple Salesforce Lightning Web Components using lightning layout?

  • Nikita

    Member
    August 20, 2019 at 6:28 am

    Hi Piyush,

    You have to mention the size on the layout item. When you don't mention size on layout-item, it will become flexible in terms of width and each item occupy width according to its content. Total horizontal size is divided into 12 parts.

    For Example

    Size should be 6 for 50:50.

    <div class="c-container">
        <lightning-layout horizontal-align="spread" multiple-rows>
            <lightning-layout-item padding="around-small" size="6">
                (My 1st LWC)
            </lightning-layout-item>
            <lightning-layout-item padding="around-small" size="6">
                (My 2nd LWC)
            </lightning-layout-item>
        </lightning-layout>
    </div>

    for more detail, you can refer https://lightningdesignsystem.com/utilities/grid/

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos