Softwr

Web Development · head to head

Preact vs Lit

Preact logo

Preact

Web Development

3kB alternative to React with the same modern API

From
Free
Rated
-
Lit logo

Lit

Web Development

Lightweight library for building Web Components

From
Free
Rated
-

The short version

  • Each has a real cost: Preact compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose; Lit smaller ecosystem compared to React or Vue
  • They diverge on capability: Preact covers 3kB runtime, Lit covers Reactive properties.

Where they differ

Only the attributes on which Preact and Lit actually diverge.

Attributes where Preact and Lit differ
AttributePreactLit
Pricing modelOpen source, no licence feeUnknown
PlatformsWebWeb, Node.js

Identical on both: starting price (Free), free tier (Yes), user rating (Not yet rated), category (Web Development).

What each one covers

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 Lit

  • Reactive properties
  • Tagged template literals
  • Scoped styling with Shadow DOM
  • Web Components standard
  • Minimal bundle size

What people use each for

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 Lit
  • Marketing and content sites where JavaScript payload affects Core Web Vitalsnot Lit
  • Applications targeting low-bandwidth or low-powered devicesnot Lit

Lit

  • Building reusable component libraries across frameworksnot Preact
  • Creating design systems with scoped stylesnot Preact
  • Developing progressive web applications with minimal dependenciesnot Preact

Where each one falls short

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

Lit

  • Smaller ecosystem compared to React or Vue
  • Web Components adoption still growing in the industry
  • Requires understanding of Shadow DOM concepts

Pricing, plan by plan

Preact

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

Lit

Free

No published plan breakdown. See the Lit review.

Which should you pick?

Choose Preact if

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

Choose Lit if

  • You need reactive properties.
  • You want to start without paying.
  • You work on Web, Node.js.
  • You also want tagged template literals.

Questions people ask

Is Preact or Lit better?
Neither clearly leads. Preact starts at Free and Lit at Free, and user ratings are close enough to be indistinguishable. Choose on capability and platform support.
Which is cheaper, Preact or Lit?
Preact starts at Free and Lit at Free.
Does Preact or Lit run on more platforms?
Preact runs on Web. Lit runs on Web, Node.js.
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 Lit is typically brought in for.
What can Preact do that Lit cannot?
Preact covers 3kB runtime, preact/compat, Same modern API, Fast rendering. Lit covers Reactive properties, Tagged template literals, Scoped styling with Shadow DOM, Web Components standard.

Answered from the vendors’ own pages

Preact: Is Preact free?

Yes, open source under the MIT licence.

Lit: Is Lit free to use?

Yes, Lit is open source and completely free under the BSD 3-Clause license.

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.

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.

Share

Related pages

Other head to heads