I would like to know whether the following is possible.

I have created two custom lighting component called menu and menu-item

Can I use these two as follows.

    <c-menu-item lable="item1"/>
    <c-menu-item lable="item2"/>

I have seen some standard components use this pattern.

1 Answer 1


You can certainly do this with the help of slots.

In your template markup for the c-menu component you will leave an unnamed slot there as below

  <!-- all markups-->
   <slot> </slot>

You must log in to answer this question.

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