# matthewp/haunted

React's Hooks API implemented for web components 👻

Repository: https://github.com/matthewp/haunted
Canonical: https://ross.abutalabs.com/products/haunted
Language: TypeScript
License: BSD-2-Clause
License Family: permissive
Topics: hooks, lit-html, react-hooks, web-components
Last push: 2026-08-24T10:02:59+00:00

## Health v2 (maintenance only)
Score: 79/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 40, longevity 100
- inputs: {"age_days": 2867, "days_push": 9, "days_rel": 558, "gap_med": 3, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2718, forks 90 (observed 2026-08-28T04:07:12.221323+00:00)

## What it is
Haunted is a TypeScript library that brings React's Hooks API (useState, useEffect, useContext, etc.) to standard web components, using lit-html or hyperHTML as renderers. It lets you define custom elements as plain functions with hooks, reusing existing React hooks from npm via bundler aliasing.

## Use cases
- use react hooks in web components
- build custom elements without a framework
- write function-based web components with state
- reuse react hooks libraries in web components
- lightweight alternative to react for component development
- create web components with lit-html rendering

## When to choose
- you want React-style hooks ergonomics in standards-based web components
- you need framework-agnostic components usable across React, Vue, or plain HTML
- you prefer a tiny library over a full framework like React or Lit

## When to avoid
- you are building a full React application with its ecosystem
- you need class-based web components or Lit's full feature set
- your team has no familiarity with the hooks mental model

## Facets
- artifact type: library
- maturity: active
- function: frontend-framework, ui-components, state-management
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: web-components, react-hooks, lit-html, hyperhtml, custom-elements, shadow-dom, web-server, nodejs

## Member repositories
- matthewp/haunted (main) score 79

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:12.221323+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:15:19.310137+00:00, confidence not recorded.
  - readme: https://github.com/matthewp/haunted (fetched 2026-08-28T04:07:12.221323+00:00, sha 9f954bcbece3)
  - registry_npm: https://registry.npmjs.org/haunted (fetched 2026-08-29T09:58:36.438872+00:00, sha 814a96c0d6f4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
