Softwr
Stencil logo

Stencil

MIT licensed toolchain for building reusable Web Component libraries in TypeScript

Stencil is free to use. Stencil is an open source toolchain from the Ionic team that compiles TypeScript and JSX components into standard Web Components usable in any framework. Softwr lists it under Web Development. Stencil is made by Ionic, available on Web, Windows, macOS, Linux.

Overview

What is Stencil?

Stencil is a toolchain for building scalable component systems on top of TypeScript and Web Component standards, built by the Ionic team and released under the MIT licence. Developers write components in TypeScript with decorators and JSX templating, in a style similar to class based React components, and Stencil compiles them into standard Web Components that work in React, Angular, Vue or no framework at all. Components can use Shadow DOM and slots through standard browser APIs. The website lists an asynchronous rendering pipeline, optimisation for tree shaking and loading, documentation generation from JSDoc comments, and developer tooling that includes a dev server with hot reloading, sourcemaps, unit testing and code generation. It has integration guides for Angular, React and Vue, and the repository topics mention server side rendering and static site generation. Stencil can act as a replacement for a traditional front end framework, although that use is optional, and its main audience is teams that publish design systems or shared component libraries to be consumed by several applications. Stencil is free and open source, so there are no plans or fees. It is a compiler and toolchain for components, not a full application framework with routing and data fetching built in, and teams must learn Web Component conventions and TypeScript decorators. Projects with a single application and no need to share components may find a regular framework simpler.

What people use it for

  • Publishing a design system as Web Components
  • Sharing UI components across React, Angular and Vue apps
  • Building framework independent widgets
  • Generating documentation for component libraries
  • Building progressive web apps with Web Components

The honest half

Where does Stencil fall short?

The limits buyers hit most with Stencil: aimed at component libraries, so routing and data fetching must come from elsewhere; and requires TypeScript and decorator conventions that differ from other frameworks. Each is concrete and checkable: the half of a review a vendor will not write.

  • Aimed at component libraries, so routing and data fetching must come from elsewhere
  • Requires TypeScript and decorator conventions that differ from other frameworks
  • Web Component styling and form handling can need extra work in some host frameworks
  • Smaller ecosystem of third party components than the largest frameworks

Cross-shopped

What are the alternatives to Stencil?

The closest alternatives to Stencil are Lit, Svelte and Preact. Each is a tool buyers genuinely weigh against it, with the reason why.

  • Stencil vs Lit

    Lit: Lightweight base class for writing Web Components with less tooling

  • Stencil vs Svelte

    Svelte: Compiler based framework that can also output custom elements

  • Stencil vs Preact

    Preact: Small React compatible library for building component based interfaces

  • Stencil vs SolidJS

    SolidJS: Fine grained reactive library with JSX, for application level interfaces

  • Stencil vs Angular

    Angular: Full application framework that can also export components as elements

Capabilities

What can Stencil do?

Stencil lists 8 features, including shadow DOM and slots support; asynchronous rendering pipeline; and dev server with hot reloading.

  • Compiles TypeScript and JSX to Web Components

  • Shadow DOM and slots support

  • Output optimised for tree shaking and loading

  • Asynchronous rendering pipeline

  • Documentation generated from JSDoc comments

  • Dev server with hot reloading

  • Unit testing and code generation tooling

  • Integration guides for Angular, React and Vue

Answered, with sources

Questions people ask

Each answer names the page it came from, so you can check it rather than take our word for it.

What does Stencil produce?

Stencil compiles components written in TypeScript and JSX into standard Web Components. These work in any major framework or without one.

Source
Is Stencil free?

Yes. The project is released under the MIT licence according to both its website and its GitHub repository.

Source
Who builds Stencil?

The README says Stencil is built by the Ionic team. The website describes it as an open source project by Ionic.

Source
Does Stencil work with React, Angular and Vue?

Yes. Components are plain Web Components, and the website provides integration guides for Angular, React and Vue.

Source

Checked against

Sources

The pages the facts above were read from. Prices and limits change, so the vendor's own page is the final word.

Share

Keep looking

Where to go from Stencil

Best Web Development software for

Compare Stencil with

Other Web Development software

  • Google's TypeScript framework for building web applications

    Free plan12 researched notes
  • Lightweight library for building Web Components

    Free plan10 researched notes
  • JavaScript framework that compiles components to small fast web apps

    Free plan10 researched notes
  • 3kB alternative to React with the same modern API

    Open source11 researched notes
  • Reactive JavaScript framework with no virtual DOM

    Open source11 researched notes
  • JavaScript with syntax for types

    Free plan15 researched notes
  • CSS with superpowers

    Free plan8 researched notes
  • React component library implementing Material Design

    Free plan11 researched notes
  • Accessible React component library with a style-props API

    Open source13 researched notes
  • React component library of over a hundred components with hooks, under the MIT licence

    Open source14 researched notes
  • Enterprise React component library from Ant Group, built for dense data heavy back office interfaces

    Open source13 researched notes
  • A progressive Node.js framework for efficient, reliable and scalable server-side apps

    Free plan11 researched notes
  • Open source JavaScript library for DOM traversal, events, animation and Ajax

    Free plan12 researched notes
  • Add memberships and logins to any website

    Free, then $29/mo9 researched notes
  • A popular general-purpose scripting language that is especially suited to web development

    Free plan13 researched notes
  • Open-source React UI component suite with over 130 components, from PrimeTek

    Free plan12 researched notes
  • Free PHP web application framework and set of reusable PHP components

    Free plan12 researched notes
  • Material Design component framework for Vue, MIT licensed with paid support subscriptions available

    Open source14 researched notes

Softwr does not host reviews and shows no star rating for Stencil, because a rating we did not collect is not ours to publish. What is here is the pricing and platform detail from the vendor’s own pages, limitations we could state concretely, and alternatives a reviewer confirmed people weigh against it. Tell us if any of it is wrong.

More on Stencil

Best Web Development software alternatives

Git-connected hosting for static sites and full-stack frontends on Cloudflare's network

freemium

Open-source React UI component suite with over 130 components, from PrimeTek

open-source

Open-source React and React Native component library with optional paid Pro templates

open-source

Free PHP web application framework and set of reusable PHP components

open-source

JavaScript static site generator that builds directories of templates into HTML

open-source

Open source JavaScript compiler that converts newer syntax to browser-compatible code

open-source

German website builder with a free plan and paid plans for domains and shops

freemium

Open source JavaScript library for DOM traversal, events, animation and Ajax

open-source

Compare Stencil with alternatives