12

Main question:

Are Container components usable in the Lightning App Builder where I can put child components on it via point-and-click possible at all?

I'm looking for something like the standard Tabs component. Can we create a container component like that?

If this is currently not supported:

  • is this on the roadmap?
  • what is the correct name of that feature? (it might be called or related to the terms 'placeholders' or 'regions' but this is unsure, and more feedback is required)
  • for which release this feature is targeted?
  • is there a pilot program?

If this is currently supported:

Is there any example with source code or detailed documentation on how to create a Lightning Component, which acts as a container for sub components in the Lightning App Builder?

Why do I need this?

I need to create collapsible sections which can also be made invisible by conditions. The content needs to be designable in the App Builder. (Edit: this was only my first need. In the meantime I figured dozens of meaningful missing usecases like better Tabs, better and more flexible Layouts and nested sub-Layouts all kinds of Panels and so on. Don't want to wait on Salesforce providing all that for me)

If possible (which seems unlikely, but I haven't given up yet) I just need a simple example, the rest I can do on my own.

  • Is this for a lightning page Uwe? If so, this is native functionality with SLDS that shouldn't require a componet, but instead more of a template. – crmprogdev Dec 25 '16 at 13:14
  • @crmprogdev yes and no: yes, let's assume the outer container is a Flexipage in LEX. And no, I'm looking only for an answer about if we actually are able create a Lightning Component like the Tabs Component or not. I wasn't able to find anything in the docs, so my assumption: the Tabs-compo is beyond what we can do right now. But I'm not sure about it and if it's not possible today, I'm pretty sure it's on the roadmap. Bottom-line: I need to get more details to plan ahead appropriately. – Uwe Heim Dec 25 '16 at 16:48
  • @UweHeim I think it's better to reach out to the Lightning Team via Partner Community to get more details about it. – Praveen Dec 25 '16 at 17:38
  • 1
    @Praveen thanks for your suggestion. I've posted this question now additionally on the Partner Community. There on the Groups "Lightning and Components" and "Lightning Components - Trailblazers" with backlinks to here. – Uwe Heim Dec 28 '16 at 15:46
3

I've got some feedback from Salesforce:

As we all guessed right, this feature is not available yet. (At least in Winter'17 release)

It seems to be on the roadmap to support custom "container" components similar to the Tabs component that allow you to nest components. The standard Tabs component is currently the only option now.

I was not able to find any ETA or timeframe on this feature.

I would be very happy, if somebody from Salesforce could verify, correct or extend this information. In the meantime I hope this answer will save others looking for it the hours of research I've spent to come to that conclusion. I'm sure not to be alone with this need.

Btw. The bounty is still open for 3 days (writing this on 2016-12-29) and I will happily provide it to anyone who comes with an better answer.

  • If you guys have an idea posted for the same, we can upvote ? – Abhinav Gupta Jul 31 '17 at 5:43
3
+50

you're right that this isn't supported yet, and there's no public scheduled roadmap for this (2016-12-29). That said, the use case is clear and obviously useful to a lot of people.

If you've seen John Belo's Advanced Lightning Apps webinar he suggests a pattern that might help you though.

Here's what I would do. I acknowledge that this is not the same as the nice interface you're looking for. Create a custom metadata type for your ComponentConfigGroup. Then, another custom metadata type for ComponentConfigItems with a metadata relationship to the group.

I'd define one "group" per page you want to use your component on, and it'd have n "items", which each define their content and the conditions. Then, in Lightning App Builder, you drag over one global component and type in the DevName of your group metadata record.

On the roadmap (I've heard pilot in summer, safe harbor) is some level of dynamic function added to the design/attributes pane in app builder, which might let you display all your groups for the user to select.

2

With Winter 18 there are now a couple of features that could cover some of your use cases:

  • You can now create your own Custom Page Templates. Custom Page Templates are essentially Lightning Components with some additional metadata, so you could for example implement regions that are collapsible.

  • With the Dynamic Lightning Pages feature, you can define visibility rules on individual components.

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.