- v1.9.3Latest
- v1.9.2
- v1.9.0
- v1.8.23
- v1.8.22
- v1.8.21
- v1.8.20
- v1.8.19
- v1.8.18
- v1.8.17
- 1.8.18
- 1.8.17
- v1.8.16
- v1.8.15
- v1.8.14
- v1.8.13
- v1.8.12
- v1.8.11
- v1.8.10
- v1.8.9
- v1.8.8
- v1.8.7
- v1.8.6
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.7.12
- v1.8.0
- v1.7.11
- v1.7.10
- v1.7.9
- v1.7.8
- v1.7.7
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.6.15
- v1.7.0
- v1.7.0-beta.5
- v1.6.16
- v1.7.0-beta.4
- v1.7.0-beta.2
- v1.7.0-beta.1
- v1.7.0-beta.0
- v1.6.14
- v1.6.13
- v1.6.12
- v1.6.11
- v1.6.10
- v1.6.9
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.5.0-beta.6
- v1.5.0-beta.7
- v1.5.0-beta.5
- v1.5.0-beta.4
- v1.5.0-beta.3
- v1.5.0-beta.1
- v1.5.0-beta.2
- v1.4.8
- v1.5.0-beta.0
- v1.4.7
- v1.4.6
- v1.4.5
Solid is a declarative JavaScript library for creating user interfaces. It does not use a Virtual DOM. Instead it opts to compile its templates down to real DOM nodes and wrap updates in fine grained reactions. This way when your state updates only the code that depends on it runs.
Key Features
- Real DOM with fine-grained updates (No Virtual DOM! No Dirty Checking Digest Loop!).
- Declarative data
- Simple composable primitives without the hidden rules.
- Function Components with no need for lifecycle methods or specialized configuration objects.
- Render once mental model.
- Fast!
- Almost indistinguishable performance vs optimized painfully imperative vanilla DOM code. See Solid on JS Framework Benchmark.
- Fastest at Server Rendering in the Isomorphic UI Benchmarks
- Small! Completely tree-shakeable Solidās compiler will only include parts of the library you use.
- Supports and is built on TypeScript.
- Supports modern features like JSX, Fragments, Context, Portals, Suspense, Streaming SSR, Progressive Hydration, Error Boundaries and Concurrent Rendering.
- Works in serverless environments including AWS Lambda and Cloudflare Workers.
- Webcomponent friendly and can author Custom Elements
- Context API that spans Custom Elements
- Implicit event delegation with Shadow DOM Retargeting
- Shadow DOM Portals
- Transparent debugging: a
<div>
is just a div.
Solid Website and come chat with us on our Discord
Learn more on theThe Gist
import { render } from "solid-js/web";
const HelloMessage = props => <div>Hello {props.name}</div>;
render(() => <HelloMessage name="Taylor" />, document.getElementById("hello-example"));
A Simple Component is just a function that accepts properties. Solid uses a render
function to create the reactive mount point of your application.
The JSX is then compiled down to efficient real DOM expressions:
import { render, template, insert, createComponent } from "solid-js/web";
const _tmpl$ = template(`<div>Hello </div>`);
const HelloMessage = props => {
const _el$ = _tmpl$.cloneNode(true);
insert(_el$, () => props.name);
return _el$;
};
render(
() => createComponent(HelloMessage, { name: "Taylor" }),
document.getElementById("hello-example")
);
That _el$
is a real div element and props.name
, Taylor
in this case, is appended to its child nodes. Notice that props.name
is wrapped in a function. That is because that is the only part of this component that will ever execute again. Even if a name is updated from the outside only that one expression will be re-evaluated. The compiler optimizes initial render and the runtime optimizes updates. Itās the best of both worlds.
Want to see what code Solid generates:
Try it Online
Quick Start
You can get started with a simple app by running the following in your terminal:
> npx degit solidjs/templates/js my-app
> cd my-app
> npm i # or yarn or pnpm
> npm run dev # or yarn or pnpm
Or for TypeScript:
> npx degit solidjs/templates/ts my-app
> cd my-app
> npm i # or yarn or pnpm
> npm run dev # or yarn or pnpm
This will create a minimal client-rendered application powered by Vite.
Or you can install the dependencies in your own project. To use Solid with JSX (recommended) run:
> npm install solid-js babel-preset-solid
The easiest way to get setup is add babel-preset-solid
to your .babelrc, or babel config for webpack, or rollup:
"presets": ["solid"]
For TypeScript remember to set your TSConfig to handle Solidās JSX by:
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "solid-js",
}
Documentation
Check out the Documentation website.
Browser Support
The last 2 versions of modern evergreen browsers and Node LTS.
Community
Come chat with us on Discord
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]