stencil VS lit

Compare stencil vs lit and see what are their differences.

stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase. (by ionic-team)

lit

Lit is a simple library for building fast, lightweight web components. (by lit)
Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • InfluxDB - Access the most powerful time series database as a service
  • Sonar - Write Clean JavaScript Code. Always.
stencil lit
44 107
11,484 14,074
1.1% 3.0%
9.8 9.0
3 days ago 2 days ago
TypeScript TypeScript
GNU General Public License v3.0 or later BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

stencil

Posts with mentions or reviews of stencil. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-02-27.
  • The benefits of Web Component Libraries
    4 projects | dev.to | 27 Feb 2023
    Web component browser APIs aren't that many, and not that hard to grasp (if you don't know about them, have a look at Google's Learn HTML section and MDN's Web Components guide); but creating a web component actually requires taking care of many small things. This is where web component libraries come in very handy, freeing us of having to think about some of those things by taking care of them for us. Most of the things I'll mention here are handled one way of another by other libraries (GitHub's Catalyst, Haunted, Hybrids, Salesforce's LWC, Slim.JS, Ionic's Stencil) but I'll focus on Google's Lit and Microsoft's FAST here as they probably are the most used web component libraries out there (ok, I lied, Lit definitely is, FAST not that much, far behind Lit and Stencil; but Lit and FAST have many things in common, starting with the fact that they are just native web components, contrary to Stencil that compiles to a web component). Both Lit and FAST leverage TypeScript decorators to simplify the code even further so I'll use that in examples, even though they can also be used in pure JS (decorators are coming to JS soon BTW). I'll also leave the most apparent yet most complex aspect for the end.
  • Web Components
    5 projects | reddit.com/r/web_design | 9 Dec 2022
    Look into https://stenciljs.com/ .
    5 projects | reddit.com/r/web_design | 9 Dec 2022
    We used https://stenciljs.com/ for web components to be consumed by angular, AEM and react at a previous employer. It uses tsx/jsx. Components are easy to write and it has good documentation.
  • Hexagonal architecture as a solution to the obsolescence of UI frameworks
    4 projects | dev.to | 7 Nov 2022
    For the creation of web components, even though writing in vanilla js is an option, we have chosen to do it via a dedicated framework, which will solve many potential integration/bundling problems. The choice of the framework will be made according to different factors that are not part of the scope of this article.
  • Ask HN: Help me pick a front-end framework
    13 projects | news.ycombinator.com | 11 Sep 2022
    Maybe have a look at Stencil (+ Ionic). https://stenciljs.com/

    Pro:

    - Simple to learn

    - Doesn't change all the time

    - First-class TypeScript support

    - Good default UI via Ionic

    - Compiles to Web Components (although to be honest, this doesn't really matter)

    - Easy testing

    - Ionic as a company invests in Ionic the framework + Stencil the compiler. Might be around in 10 years, altough things could change. But this is true for all frameworks.

    - You basically get an iOS/Android app for free, if you just dump the output in Capacitor (also developed by Ionic the company).

    Cons:

    - Stencil is not very widespread as a frontend framework.

  • A Letter to D1sc0rd for not Supporting the Linux Desktop
    7 projects | reddit.com/r/linux | 29 May 2022
    because react-native is only reactlike. I may or may not want to stick with that. I think something like this is leading us towards a better and less UI lib specific approach. https://github.com/ionic-team/stencil/ . I don't think is 100% where we end up, but it is based on web components, so it's moving the entire ecosystem forward, not just a slice of it.
  • By Crayons and For Crayons
    12 projects | dev.to | 13 May 2022
    The app is built using vanilla Web Components without using any component publishing libraries like Stencil, Lit and so on. The reason being I met with some roadblocks in building a drag-n-drop editor using these libraries. Actually the Crayons Team itself is using Stencil to build the Crayons components using TypeScript and React-like component semantics and finally publish them as platform native Web components and React wrappers for the same. You can find out more about this in the Stencil documentation.
  • Why we chose WebComponents for our Design System
    4 projects | dev.to | 5 May 2022
    Stencil
  • A Quick Guide to Mitosis: Why You Need It and How You Can Use It
    5 projects | dev.to | 4 May 2022
    This might sound very similar to the work the Ionic team did with Stencil. The one main difference is that we're not just outputting web components. Rather full framework-ready JavaScript. You can even compile the output to Stencil as well.
  • The Case for Web Components
    2 projects | dev.to | 14 Apr 2022
    While you can build components directly from the supporting Web APIs, you might find it productive to use a library that's been built to support this task. Lit and StencilJS are two of several libraries with acompanying tooling to help you build web components. And because they compile to the same 'target', they give you an additonal advantage: if you choose to switch web component libraries at some point in the future, you can make the switch for new components without having to rewrite the old ones, and use both in the same application.

lit

Posts with mentions or reviews of lit. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-22.
  • A Generalized User-local Container for UI State in Kredis
    3 projects | dev.to | 22 Mar 2023
    , Shoelace, Lit, etc.). Wrapping Up In part one of this series, we described what Kredis can and cannot do, and developed an example use case for storing ephemeral UI state using a bespoke Redis key. In this second and final part, we identified the drawbacks of this approach. We developed a generalized solution to apply to any DOM node whose state of attributes we want to track on the server side. Finally, let me point out that these considerations inspired me to develop a library called solder, which I would be happy to receive feedback on! Happy coding! P.S. If you'd like to read Ruby Magic posts as soon as they get off the press, subscribe to our Ruby Magic newsletter and never miss a single post!
  • Introducing react.dev: the new React docs site!
    5 projects | reddit.com/r/reactjs | 16 Mar 2023
  • Testing Web Components with @web/test-runner
    4 projects | dev.to | 16 Mar 2023
    npm test > [email protected] test > tsc && wtr --coverage dist/test/testing-components.test.js: 🚧 Browser logs: Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information. Chrome: |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 test files | 4 passed, 0 failed Code coverage: 100 % View full coverage report at coverage/lcov-report/index.html Finished running tests in 9s, all tests passed! πŸŽ‰
  • The benefits of Web Component Libraries
    4 projects | dev.to | 27 Feb 2023
    Web component browser APIs aren't that many, and not that hard to grasp (if you don't know about them, have a look at Google's Learn HTML section and MDN's Web Components guide); but creating a web component actually requires taking care of many small things. This is where web component libraries come in very handy, freeing us of having to think about some of those things by taking care of them for us. Most of the things I'll mention here are handled one way of another by other libraries (GitHub's Catalyst, Haunted, Hybrids, Salesforce's LWC, Slim.JS, Ionic's Stencil) but I'll focus on Google's Lit and Microsoft's FAST here as they probably are the most used web component libraries out there (ok, I lied, Lit definitely is, FAST not that much, far behind Lit and Stencil; but Lit and FAST have many things in common, starting with the fact that they are just native web components, contrary to Stencil that compiles to a web component). Both Lit and FAST leverage TypeScript decorators to simplify the code even further so I'll use that in examples, even though they can also be used in pure JS (decorators are coming to JS soon BTW). I'll also leave the most apparent yet most complex aspect for the end.
  • Need an advice for frontend framework (beginner in frontend development)
    5 projects | reddit.com/r/Frontend | 25 Feb 2023
    Depending on your needs, a "vanilla" JS option is also entirely possible using Web Components. You can use them on their own, or if you need a little more behind it, you can use something like Lit. https://lit.dev/
  • Xeito - A framework for building web applications
    5 projects | reddit.com/r/javascript | 22 Feb 2023
    Looks very much like Lit (https://lit.dev/), which is not a bad thing.
  • Writing JavaScript without a build system
    13 projects | news.ycombinator.com | 16 Feb 2023
    > I’d love more tips for no-build-system javascript

    1. MDN has a comprehensive guide on JavaScript modules [0]

    2. A build system free way to build interactive websites could be to combine libraries like htmx[1] and or lit[2] or just the sub package lit-html[3]. Or just go with native web components and a bit of AJAX.

    [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...

    [1] https://github.com/bigskysoftware/htmx

    [2] https://github.com/lit/lit

    [3] https://github.com/lit/lit/tree/main/packages/lit-html

  • Implementing a Command Palette and Task Timer (part 1)
    8 projects | dev.to | 5 Feb 2023
    Ninja Keys uses Lit while command-pal uses Svelte. I don't have any experience with either, so.... Both of them can bind any command on the palette to a hotkey thanks to hotkeys.js. Both are MIT licensed. Command-pal is larger in size, but it also bundles all the libraries it needs. It looks like Ninja Keys loads libraries/modules on demand from CDNs on the internet. Being able to use the library without internet access is a nice feature.
  • Polymode: Multiple Major Modes and How to Use SQL and Python in One Buffer
    3 projects | news.ycombinator.com | 4 Feb 2023
    My head is already coming up with use-cases such as JS template literals (think lit [0] for HTML and CSS templates), and the recently-shared Expr [1]. This is really neat. Thanks for sharing.

    [0] https://lit.dev/

  • What is your ideal setup for new project for solo developers
    6 projects | reddit.com/r/node | 3 Feb 2023
    My go-to front end these days is Lit with web components, rollup, and web dev server.

What are some alternatives?

When comparing stencil and lit you can also consider the following projects:

Svelte - Cybernetically enhanced web apps

Vue.js - This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

Angular - The modern web developer’s platform

vite-ssg - Static site generation for Vue 3 on Vite

Preact - βš›οΈ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.

minze - Dead-simple JS framework for native web components.

css-modules - Documentation about css-modules

shoelace-css - A collection of professionally designed, every day UI components built on Web standards. Works with all framework as well as regular HTML/CSS/JS. πŸ₯Ύ

webcomponents - Web Components specifications

turbo - The speed of a single-page web application without having to write any JavaScript

storybook - Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.