Softwr

Web Development · head to head

Preact vs Stencil

Preact logo

Preact

Web Development

3kB alternative to React with the same modern API

From
Free
Free plan
Yes
Stencil logo

Stencil

Web Development

MIT licensed toolchain for building reusable Web Component libraries in TypeScript

From
Free
Free plan
Yes

The short version

  • Stencil is an open source toolchain.
  • Both are free.
  • Only Preact lists 3kB runtime; only Stencil lists shadow DOM and slots support.
  • Where Preact falls short: compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose.
  • Where Stencil falls short: aimed at component libraries, so routing and data fetching must come from elsewhere.
  • Prices and features on this page were last checked on 20 November 2026.

How do Preact and Stencil differ?

Preact and Stencil differ on pricing model and platforms. Only the attributes on which Preact and Stencil actually diverge.

Attributes where Preact and Stencil differ
AttributePreactStencil
Pricing modelOpen source, no licence feeOpen-source
PlatformsWebWeb, Windows, macOS, Linux

Identical on both: starting price (Free), free tier (Yes), category (Web Development).

Which features does each one have?

They share no listed features; 4 appear only for Preact and 8 only for Stencil. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in Preact

  • 3kB runtime
  • preact/compat
  • Same modern API
  • Fast rendering

Only in Stencil

  • 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

What is each one used for?

Preact is most often brought in for embedded widgets that load inside someone else’s page and must stay small; Stencil for publishing a design system as Web Components. The jobs each tool is most often brought in to do.

Preact

  • Embedded widgets that load inside someone else’s page and must stay smallnot Stencil
  • Marketing and content sites where JavaScript payload affects Core Web Vitalsnot Stencil
  • Applications targeting low-bandwidth or low-powered devicesnot Stencil

Stencil

  • Publishing a design system as Web Componentsnot Preact
  • Sharing UI components across React, Angular and Vue appsnot Preact
  • Building framework independent widgetsnot Preact
  • Generating documentation for component librariesnot Preact
  • Building progressive web apps with Web Componentsnot Preact

Where do Preact and Stencil fall short?

Preact's most cited limit: behavioural differences from React exist in edge cases, particularly around event handling. Stencil's: aimed at component libraries, so routing and data fetching must come from elsewhere. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

Preact

  • Compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose
  • Behavioural differences from React exist in edge cases, particularly around event handling
  • A much smaller community, so unusual problems have fewer existing answers than React

Stencil

  • 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

How much do Preact and Stencil cost?

Preact is free to use; Stencil is free to use. Plan by plan below, from each vendor's own pricing page.

Preact

Free
  • PreactFree
    • Full library
    • Commercial use permitted
    • No usage limits

Stencil

Free

No published plan breakdown. See the Stencil review.

Which should you pick?

Choose Preact if

  • You need 3kb runtime.
  • You want to start without paying.
  • You also want preact/compat.

Choose Stencil if

  • You need compiles typescript and jsx to web components.
  • You want to start without paying.
  • You work on Web, Windows, macOS, Linux.
  • You also want shadow dom and slots support.

Questions people ask

Is Preact or Stencil better?
Neither clearly leads. Preact starts at Free and Stencil at Free, and user ratings are close enough to be indistinguishable. Choose on capability and platform support.
Which is cheaper, Preact or Stencil?
Preact starts at Free and Stencil at Free.
Does Preact or Stencil run on more platforms?
Preact runs on Web. Stencil runs on Web, Windows, macOS, Linux.
Can I use Preact for free?
Both have a free tier, so you can try either at no cost before committing.
What is Preact best used for?
Preact is most often used for embedded widgets that load inside someone else’s page and must stay small, marketing and content sites where javascript payload affects core web vitals, applications targeting low-bandwidth or low-powered devices. Of those, embedded widgets that load inside someone else’s page and must stay small and marketing and content sites where javascript payload affects core web vitals are not what Stencil is typically brought in for.
What can Preact do that Stencil cannot?
Preact covers 3kB runtime, preact/compat, Same modern API, Fast rendering. Stencil covers Compiles TypeScript and JSX to Web Components, Shadow DOM and slots support, Output optimised for tree shaking and loading, Asynchronous rendering pipeline.

Answered from the vendors’ own pages

Preact: Is Preact free?

Yes, open source under the MIT licence.

Stencil: 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
Preact: Can I use React libraries with Preact?

Most, through the preact/compat layer. Compatibility is good but not complete, so libraries relying on React internals can break.

Stencil: Is Stencil free?

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

Source
Preact: Why choose Preact over React?

Bundle size, almost always. If payload is not a binding constraint, React’s ecosystem is usually the better trade.

Stencil: 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
Stencil: 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
Share

Related pages

Other head to heads