Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 39 ยท Getting Started

What Is SolidJS?

Meet SolidJS, the JavaScript UI library built on signals: what it is, how it differs from virtual-DOM libraries, and why it is so fast.

SolidJS is a JavaScript library for building user interfaces. You write components with JSX, much like you would in React, but underneath the syntax works very differently. Solid has no virtual DOM. Instead it builds a graph of small reactive values called signals, and when one changes, only the exact DOM nodes that depend on it are updated.

This course takes you from your first signal to routing, data loading, testing and full projects. In this first lesson you will learn what Solid is, what problem it solves, and how the pieces fit together before we write real code in the next lesson.

About the live examples. Solid's JSX needs a compiler, and your browser cannot run one inside a lesson page. So every runnable example here uses Solid's built-in html tagged-template helper (solid-js/html), which gives you the same components, signals and control-flow primitives without a build step. The JSX version of each idea is shown in read-only blocks. Everything you learn transfers directly to a real Vite project.

The core idea in one sentence

A Solid component is a function that runs once to set up the UI. After that, the parts of the page that depend on reactive values update themselves.

Compare that with a virtual-DOM library, where the component function runs again on every state change and the library compares the old and new trees to find differences. Solid skips both the re-running and the comparing.

How Solid updates the page

Component runs once Builds the DOM
Signals Hold the state
Exact updates Only what changed

No virtual DOM, no re-running components.

1 / 2

Your first signal

A signal is a pair of functions: one reads the value, one changes it. Here is a complete counter. Press the button and watch the number change.

A counter built on a signal

In a Vite project the same component is written in JSX:

JSX
import { createSignal } from "solid-js";

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

Notice that count is a function. You read the value by calling it: count(). That call is what lets Solid notice that this spot in the page depends on count. You will study this in detail in Creating Signals.

The component runs once

To see that the function really runs only one time, add a log line at the top of the component and another inside a reactive spot.

Setup runs once, updates run many times

Click the button a few times and read the console panel. "component function ran" appears exactly once. The effect logs again on every click. In a virtual-DOM library, the first message would repeat with every click.

What makes Solid different

Idea Virtual-DOM libraries SolidJS
Component function Re-runs on every update Runs once
Finding what changed Diff old and new virtual trees Signals know their subscribers
State primitive Hooks with rules (order, dependency arrays) Signals, usable anywhere
Dependency tracking You list dependencies by hand Automatic
Update cost Grows with the component tree Grows with what actually changed

This is called fine-grained reactivity. It is not new: spreadsheets work this way. If cell C1 is =A1+B1, changing A1 recalculates C1 and nothing else. Solid brings that model to UI code.

What Solid is not

Solid is a library, not a framework. The core package gives you reactivity, components, control-flow components and a renderer. For routing, server rendering and file-based pages you add SolidStart, the official meta-framework, and for client routing alone you add @solidjs/router. Those come later in the course.

Who uses it and when it fits

Solid works well when you care about performance on large or frequently updating interfaces, such as dashboards, tables and editors, and when you like a small mental model with few rules. Its ecosystem is smaller than React's, so for niche widgets you may wrap a plain JavaScript library yourself. You will learn how in Refs and Directives.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. How many times does a Solid component function run?

    The function sets up the DOM and the reactive graph once. Later updates happen through signals, not by re-running the function.
  2. 2. How do you read the current value of a signal named count?

    A signal getter is a function. Calling it returns the value and registers the caller as a subscriber.
  3. 3. Which technique does Solid use instead of a virtual DOM?

    Signals track exactly which DOM updates depend on them, so changes go straight to those nodes.
  4. 4. Why do the lessons here use the solid-js/html helper?

    The html tagged template runs in the browser without a build step. In real projects you normally use JSX compiled by Vite.

Summary

  • SolidJS builds UIs from signals, effects and components written in JSX.
  • Components run once; reactive expressions update the exact DOM nodes that depend on them.
  • There is no virtual DOM and no dependency arrays.
  • A signal is read by calling it: count().
  • Lesson examples use solid-js/html; real projects use compiled JSX.

Next: Setting Up and Your First App