A declarative, efficient, and flexible JavaScript library for building user interfaces.
  • TypeScript 99%
  • JavaScript 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Balazs Horvath 9276a7acad
Some checks failed
CodSpeed / Run benchmarks (push) Has been cancelled
chore: update package.json, pnpm-lock, and pnpm-workspace config
2026-06-05 01:19:58 +02:00
.changeset Merge pull request #2722 from brenelz/fix-store-primitive-array-map 2026-05-29 09:19:06 -07:00
.cursor/rules Merge remote-tracking branch 'upstream/next' into next 2026-06-02 10:10:45 +02:00
.github/workflows Merge remote-tracking branch 'upstream/next' into next 2026-06-02 10:10:45 +02:00
assets Adjusted size of Solid logo and adjusted references to solidui 2021-05-22 18:38:29 -04:00
documentation fix: remove ambient refresh state 2026-05-29 03:03:19 -07:00
examples chore: add migrating element example 2026-05-18 11:58:12 -07:00
packages Merge remote-tracking branch 'upstream/next' into next 2026-06-02 10:10:45 +02:00
scripts work around Node fs.cpSync prefix bug; bump vite-plugin-solid 2026-04-17 10:31:34 -07:00
.editorconfig build fixes 2020-12-02 20:16:18 -08:00
.gitignore Merge remote-tracking branch 'upstream/next' into next 2026-06-02 10:10:45 +02:00
.gitpod.yml chore: add pnpm and prettier to gitpod.yml (#1205) 2022-09-04 01:43:05 -07:00
.nvmrc v1.9.12 2026-03-24 14:36:49 -07:00
.prettierrc remove unnecessary type annotations 2020-04-23 20:45:16 -07:00
banner.png Added banner 2021-12-09 17:42:01 -05:00
CHANGELOG.md Fix documentation typos 2026-05-14 15:40:01 -07:00
LICENSE chore: update copyright year (#2397) 2025-02-21 11:00:34 -08:00
package.json chore: update package.json, pnpm-lock, and pnpm-workspace config 2026-06-05 01:19:58 +02:00
pnpm-lock.yaml chore: update package.json, pnpm-lock, and pnpm-workspace config 2026-06-05 01:19:58 +02:00
pnpm-workspace.yaml chore: update package.json, pnpm-lock, and pnpm-workspace config 2026-06-05 01:19:58 +02:00
pnpm-workspace.yaml.bak Merge remote-tracking branch 'upstream/next' into next 2026-06-02 10:10:45 +02:00
README.md Move JSX types to renderer packages 2026-04-29 17:42:36 -07:00
tsconfig.composite.json chore: sync dependencies (monorepo) 2026-04-09 21:35:28 +02:00
tsconfig.json chore(tsconfig): enable skipLibCheck for @types/node 25 compatibility 2026-05-11 11:31:35 -07:00
tsconfig.test.json chore(deps): upgrade vitest to 4.1.6 to fix RPC timeout under CodSpeed 2026-05-11 12:41:20 -07:00
turbo.json test: fix strict-read flow type coverage 2026-05-12 17:08:31 -07:00
turbo.json.bak Merge remote-tracking branch 'upstream/next' into next 2026-06-02 10:10:45 +02:00

SolidJS

Build Status Coverage Status

NPM Version Discord Subreddit subscribers

WebsiteAPI DocsTutorialDiscord

Solid 2.0 (experimental beta)

You're on the next branch — Solid 2.0. The public API differs from 1.x: split-phase createEffect, microtask batching, Loading/Errored boundaries, draft-first store setters, async-in-computations, removed solid-js/web and solid-js/store subpaths, and more.

Solid is a declarative JavaScript library for building user interfaces. Instead of a Virtual DOM, it compiles templates to real DOM nodes and updates them with fine-grained reactivity. Declare your state and use it throughout your app — when a piece of state changes, only the code that depends on it re-runs.

At a glance (Solid 2.0)

import { createSignal } from "solid-js";
import { render } from "@solidjs/web";

function Counter() {
  const [count, setCount] = createSignal(0);
  const doubled = () => count() * 2;

  // The component body runs once. Only `{doubled()}` updates when count changes.
  return <button onClick={() => setCount(c => c + 1)}>{doubled()}</button>;
}

render(() => <Counter />, document.getElementById("app")!);

Try it in our Playground.

Explain this!

Solid compiles your JSX to real DOM operations at build time. The component function runs once on mount; reactivity is per-expression, not per-render. The {doubled()} expression compiles to a tracked update that only touches that one DOM position when count() changes.

import { template, delegateEvents, insert } from "@solidjs/web";
import { createSignal } from "solid-js";

const _tmpl$ = /*#__PURE__*/ template(`<button>`);

function Counter() {
  const [count, setCount] = createSignal(0);
  const doubled = () => count() * 2;

  return (() => {
    const _el$ = _tmpl$();
    _el$.$$click = () => setCount(c => c + 1);
    insert(_el$, doubled);
    return _el$;
  })();
}
delegateEvents(["click"]);

Reads update on the next microtask (or call flush() for synchronous interop). Effects are split into a tracking compute phase and a side-effecting apply phase — see MIGRATION.md for the full model.

Key features

  • Fine-grained updates to the real DOM — no virtual DOM diff.
  • Declarative reactive primitives (createSignal, createMemo, createStore).
  • Render-once components — your component function is plain JavaScript that runs once.
  • Automatic dependency tracking — reading reactive state subscribes to it.
  • Microtask-batched updates with flush() for synchronous interop.
  • First-class async: any computation can return a Promise/AsyncIterable; <Loading> is the boundary.
  • Optimistic UI primitives (createOptimistic, createOptimisticStore) and structured action(...) mutations.
  • Streaming SSR and progressive hydration.
  • TypeScript-first, JSX-first, web-component friendly.
  • Universal: write custom renderers via @solidjs/universal to target non-DOM platforms.

Quick start

npm i solid-js @solidjs/web
npm i -D babel-preset-solid

Add babel-preset-solid to your Babel config (or use Vite's Solid plugin) and configure TypeScript:

{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "@solidjs/web"
  }
}

For web projects, jsxImportSource points at @solidjs/web. In 2.0, solid-js owns renderer-neutral component types, while renderer packages such as @solidjs/web and @solidjs/h own their JSX namespaces and jsx-runtime type entries.

2.0 starter templates are tracked at solidjs/templates. Existing 1.x templates target 1.x.

For LLMs / AI assistants

The public API differs from any Solid examples that predate 2.0. Before generating Solid 2.0 code, read:

The cheatsheet ships inside the solid-js npm package, so it's also reachable as node_modules/solid-js/CHEATSHEET.md from any user project.

Repository

This is a PNPM workspaces monorepo. The packages here are versioned together as 2.0.0-beta.x:

Package Path Purpose
solid-js packages/solid Core runtime — components, flow controls, context, hydration.
@solidjs/signals packages/solid-signals Reactive primitives — signals, memos, effects, stores.
@solidjs/web packages/solid-web Web platform runtime — render, hydrate, SSR, Portal, Dynamic.
@solidjs/h packages/solid-h Hyperscript / JSX factory.
solid-html packages/solid-html Build-less tagged template literals.
@solidjs/universal packages/solid-universal Universal runtime for custom renderers.
solid-element packages/solid-element Web Components wrapper.
babel-preset-solid packages/babel-preset-solid Babel preset for JSX compilation.

DOM operations live in the dom-expressions repo.

Why Solid?

Performant

Engineered for performance with years of research behind it — Solid's runtime cost is close to optimized vanilla JavaScript on the JS Framework Benchmark. Small, fully tree-shakable, fast on the server too. (Read more about Solid's performance.)

Powerful

Performant state management is built in (Context, Stores, Projections). Async is a first-class capability of computations — no separate createResource model — with <Loading> / <Errored> boundaries and isPending for revalidation indicators. Full SSR, streaming, and progressive hydration when you're ready to move to the server.

Pragmatic

Components are plain functions. Rendering is determined by how state is used — no rendering system to learn. Read-write segregation is encouraged but not enforced.

Productive

Built on JSX and TypeScript, integrates with the Vite ecosystem. Bare-metal abstractions give you direct access to the DOM. Growing ecosystem of primitives, component libraries, and build-time utilities.

More

Browser support

SolidJS Core supports the last 2 years of modern Firefox, Safari, Chrome, and Edge (desktop and mobile). IE and similar sunset browsers are not supported. For server environments, Node LTS, the latest Deno, and Cloudflare Worker runtimes are supported.

Testing Powered By SauceLabs

Community

Come chat on Discord. Solid's creator and the rest of the core team are active there, and we're always looking for contributions.

Contributors

Open Collective

Support us with a donation and help us continue our activities. [Contribute]

Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]