Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Including a component dynamically at runtime

Avatar

Level 2

Hi Guys

Is it possible to include a component dynamically  at runtime.

The use case is something like this. I have a base component say social-login component, where by I give author to choose the social-login type via a select box. The values are facebook and twitter. I have two different components then each for FB and Twitter.

On the basis of the choice of author I have to include one component and render that on the page. Is that possible, if yes can you guys please provide me any pointers?

Thanks

1 Reply

Avatar

Level 2

I was able to figure it out.

We can use <sly data-sly-test> to test and <sly data-sly-resource> to include a resource.

Please let me know if there are other ways to do it.

Thanks

Gaurav