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>

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.