What I am asking is similar to this question from 2019. I want to create a static layout and the Admin/user can simply drag and drop components into this layout. Any methods I've seen so far need the child component to be present in the code of the parent. When I look at the code for the Accordion It isn't clear how it is being done. I want to know if it is possible to do this and if so how?

1 Answer 1


There are multiple ways, but the way the Accordion is doing is through Slots:

A slot (<slot></slot>) is a placeholder for markup that a parent component passes into a component’s body.

The trick is that you can only do this under your own namespace for now unless you enable Lightning Web Security as mentioned in question.

  • Thank you. Is there any documentation on how to achieve this I can refer to? any documentation about any method to achieve this would be helpful. Jul 26, 2022 at 17:35
  • Hello Sandeep, yes, the documentation on Slots from LWC: shows an example of how to create and use either one slot, or multiple ones. Jul 27, 2022 at 8:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .