More About StencilJS

Sagar Bag
1 min readMay 21, 2022

--

In modern days, you have many different options to create a web application. And one of them is Stencil. Stencil is also a compiler for creating web components and combining those components, we can make web applications. Web components are pillars of a web application. These are actually one type of custom HTML element (<my-component></my-component>) with extra logic, which is written in JavaScript. Components of stencil are written in typescript. Stencil is a mixture of react and angular, many stencil functionality is same as react and some of them are similar to angular.

In the below I’m sharing a small snippet of code in stencil, where we have received two props firstName and lastName in <my-component/> element and we render it in our UI within a paragraph tag.

Stencil Advantages:-

  • It can be used in top front-end frameworks, and also in all the JavaScript library.
  • It’s very easy to use different frameworks & re-usable.
  • It’s do not need any run-time like of other frameworks react, Vue, angular.
  • It’s support all the major browsers, except Edge versions in between 12–18

--

--

No responses yet