StencilJS and Ionic 5

Hey folks,

just a quick question… I’m using Ionic for quite a while and I have to switch from Cordova to Capacitor and I also would like to create my own components… I could create those easily with Ionic Custom Components, but I also heard about StencilJS. Can I build components with StencilJS and import those into my Ionic application - that’s at least how I understood the concept…

Am I right or wrong? Anyone has experience with using his own Stencil components inside an Ionic (Angular) application?

Thanks in advance,

1 Like


check out the blogs from Josh Morony on StencilJS and integration. Fairly easy to find using Google. And easy to try.

I don’t know what you mean by Ionic Customer Elements, but it is actually Angular elements, then it is basically the alternative to StencilJS.

Just another way to create webcomponents using that specific API


I meant actually - let’s create a Stencil Web Component and use it within an Ionic Angular application… But anyway thanks… Josh Morony created Stencil PWA’s with custom components and using the Ionic components. Actually the other way around :wink: …at least as far, as I understood.

I think this is what I was looking for: ?

I think the question how to use stenciljs to add component in ionic 4 is strictly useless. You don’t own the ionic4 UI repository :slight_smile:

It is more about how to add stenciljs components in your beloved webapp framework (angular, vue, react, plain vanilla). After all Ionic4 is framework agnostic (react, vue, plain vanilla, angular)


Does this mean vice versa… If I create my custom component with Stencil - am I not able to use it within my Ionic application and some other framework?

Cause I don’t want to develop a custom component for Ionic and another custom for some other framework.

Let’s say - I have an Ionic app for mobiles and another application (not Ionic) as Backend Solution (Dashboard & Analytics, User creation…).

If u make a stenciljs component u can use it in an app that also uses ionic4 components.

So YES, they can co exist, and yes u can use that stencil component in another web app (providing the browser supports web components which normally the do if they are the latest version)

The world is at your feet with ionic and stencil!

Thanks for your update, cause I thought I would have completely misunderstood the concept.


1 Like