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 install solid-js
yarn add solid-js
pnpm add solid-js
Import
import { createSignal } from 'solid-js';Quick Example
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
| Package | solid-js |
| Category | Framework |
| Weekly Downloads | 200K+ |
| License | MIT |
| Install | npm install solid-js |
Related Packages
React is the most popular JavaScript library for building user interfaces, developed and maintained …
Preact is a fast 3kB alternative to React with the same modern API. It provides the thinnest possibl…
Svelte is a radical new approach to building user interfaces that shifts the work of the framework f…
Vue.js is a progressive JavaScript framework for building user interfaces, created by Evan You in 20…
Qwik is a next-generation web framework that achieves instant-loading applications through a fundame…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.