PR

Preact

preact

Fast 3kb React-compatible Virtual DOM library.

Component Libraries
preact
react
ui
user interface
virtual dom
vdom
components
dom diff
front-end
framework
Stars
39k
Weekly
0
Open issues
41
Bundle
~60 kB

Installation

npm install preact

Code example

import { Button } from "preact";

export function Example() {
  return (
    <div className="flex gap-2">
      <Button>Primary</Button>
      <Button variant="outline">Secondary</Button>
    </div>
  );
}

Pros & cons

Pros

  • Actively maintained by preactjs
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 41 open issues on GitHub

FAQs

Alternatives & similar libraries