2

When editing a page in the Lightning App Builder, we can edit the layout template:

enter image description here

I want to make my own custom template based on one of the Standard, out-of-box templates - can I view the source of those somewhere?

2

The source code for the standard templates is not public. You can inspect elements on the browser but it is hard to decipher.

Creating your own templates is simpler with lightning-layout. There are a couple of examples in the sample app Easy Spaces.

3:9 layout

4:8 layout

A sample component for 4:8 will be as below

<aura:component implements="lightning:appHomeTemplate" description="App Home template, with 2 columns in 4:8 ratio."
access="global">
<aura:attribute name="leftColumn" type="Aura.Component[]" access="global" />
<aura:attribute
    name="rightColumn"
    type="Aura.Component[]"
    access="global"
/>
    <lightning:layout>
        <lightning:layoutItem
            aura:id="leftColumn"
            size="4"
            class="left expanded"
        >
            {!v.leftColumn}
        </lightning:layoutItem>

        <lightning:layoutItem aura:id="rightColumn" size="8" class="right">
            {!v.rightColumn}
        </lightning:layoutItem>
    </lightning:layout>
  </div>
</aura:component>
6
  • LWC components became open-source recently - any plan to make Aura components open source?
    – jbyrd
    May 28 at 2:41
  • @jbyrd No those won't go open source ever since the future is all LWC! At some point LWC will be available for every interface on Salesforce platform May 28 at 3:06
  • Thanks - yeah I keep hearing that, but unfortunately the codebase on this project is mostly Aura. LWC being the future, does that also mean the lightning app builder is sort of getting deprecated, too, at some point?
    – jbyrd
    May 28 at 14:35
  • 1
    No lightning app builder won’t be deprecated but it will be LWR based! May 28 at 14:36
  • 1
    Ok created a new question for it: salesforce.stackexchange.com/q/344516/89720
    – jbyrd
    May 28 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.