You need to sign in to do that
Don't have an account?
JohnDurai
Two column layout section using LWC
Hi - I have created a LWC component for layout section as below, can someone suggest how this can be used as two column layout.
Here is my code:
<template>
<div class={sectionClass}>
<h3 class="slds-section__title">
<button class="slds-button slds-section__title-action" onclick={handleClick}>
<lightning-icon
icon-name="utility:switch"
class="slds-button__icon slds-button__icon_left slds-section__title-action-icon"
size="x-small">
</lightning-icon>
<span class="slds-truncate" title={label}>Notes</span>
</button>
</h3>
<div class="slds-section__content">
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 1">Address Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 2">Income Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 3">Health Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 4">Expense Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
</template>
Here is my code:
<template>
<div class={sectionClass}>
<h3 class="slds-section__title">
<button class="slds-button slds-section__title-action" onclick={handleClick}>
<lightning-icon
icon-name="utility:switch"
class="slds-button__icon slds-button__icon_left slds-section__title-action-icon"
size="x-small">
</lightning-icon>
<span class="slds-truncate" title={label}>Notes</span>
</button>
</h3>
<div class="slds-section__content">
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 1">Address Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 2">Income Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 3">Health Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
<div class="slds-col slds-p-horizontal_medium">
<lightning-layout>
<lightning-layout-item padding="around-small">
<div class="header-column">
<p class="field-title" title="Field 4">Expense Notes</p>
</div>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
</template>
i've Done Some Changes
Please Mark It As Best Answer If It helps
Thank You!
All Answers
Try Following Code Please Mark It As Best Answer If It helps
Thank You!
And also, I need to call another LWC component inside my current component as below example. it would be great if you give some idea how to call and place the below another componet(notes) inside the layout component which i built above.
Try The Below Code.
Please Mark It As Best Answer If It helps
Thank You!
i've Done Some Changes
Please Mark It As Best Answer If It helps
Thank You!