Framework200K+/wkMIT

solid-js

Solid is a declarative JavaScript library for creating user interfaces that compiles templates to real DOM nodes and updates them with fine-grained reactions. U

Installation

npm
npm install solid-js
yarn
yarn add solid-js
pnpm
pnpm add solid-js

Import

ESM
import { createSignal } from 'solid-js';

Quick Example

usage
import { createSignal } from 'solid-js';

function Counter() {
  const [count, setCount] = createSignal(0);
  return (
    <button onClick={() => setCount(count() + 1)}>
      Count: {count()}
    </button>
  );
}

About solid-js

Solid is a declarative JavaScript library for creating user interfaces that compiles templates to real DOM nodes and updates them with fine-grained reactions. Unlike React's virtual DOM diffing approach, Solid compiles JSX at build time into optimized DOM operations that update only the exact elements and attributes that change, without re-executing component functions after initial render. This produces exceptional performance benchmarks, often matching or exceeding hand-optimized vanilla JavaScript. Solid uses signals, memos, and effects as reactive primitives — signals hold values, memos derive computed values, and effects run side effects when their dependencies change. Components in Solid run only once during creation, with the reactive system handling all subsequent updates. This means there are no rules of hooks, no stale closure issues, and no unnecessary re-renders. Solid supports JSX with some differences from React, including native spread attributes, show/for control flow components, and portals. The framework provides Solid Router for client-side routing and SolidStart as a meta-framework for full-stack applications with SSR support.

Quick Facts

Packagesolid-js
CategoryFramework
Weekly Downloads200K+
LicenseMIT
Installnpm install solid-js

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.