Skip to main content
NewSolid 2.0 is live. Read the latest

Fine-grained reactivity.No virtual DOM.Async built in.

Simple and performant reactivity for building user interfaces. Solid 2.0 adds first-class async, optimistic actions and draft-first stores.

npm create solid@latest

Solid 2.0.0 is the current release.

Why Solid

Why Solid 2.0?

Signals, with async and mutations in the same graph.

No virtual DOM

Fine-grained reactivity

Components run once. There are no re-renders, no memoization and no dependency arrays: signals update exactly the DOM nodes that read them, down to a single text node.


Async by design

Async is part of the graph

A memo that returns a promise is still just a value: no loading flags, no cache keys and no undefined in your types. You can fetch in any component and show a loading state where you choose. The components in between don't need to know about it.

user()
the value, never undefined
isPending(user)
true while a refresh is in flight
<Loading>
fallback on first load only
<Errored>
catches a rejection

Consistent updates

The UI never shows half an update

The old content stays on screen until the new data is ready. Use isPending and latest where you need to show a pending state or the newest value.

  1. setTab("posts")the input changes
  2. isPending(() => posts())ask where the design needs it
  3. latest(tab)the newest value, mid-flight
  4. settledthe new answer lands whole

Safe mutations

Optimistic UI from the write you already make

Wrap a mutation in an action and the draft write you would make in a client-only app becomes the optimistic prediction. No snapshots and no rollback code: when the server settles, the guess discards itself, success or failure.

  1. setTodos(list => …)optimistic write shows instantly
  2. yield api.add(todo)the request is in flight
  3. refresh(todos)reconcile with the server
  4. settledthe guess gives way to server data

Full stack

Server functions that stream live values

Mark a function "use server" and call it like any other. Return an async generator and it is real-time: live() keeps the value current in the reactive graph, and broadcast() gives every viewer the same answer when it changes.

  1. "use server"typed RPC, no codegen
  2. await getUser(id)in-process during SSR
  3. live(messages)an async generator stays current
  4. broadcast(room)every viewer gets the same answer

Open source

MIT licensed and used in production

MIT licensed and used in production. These numbers come live from npm and GitHub.

npm downloads / week

—

36.3K GitHub stars198 contributors


Watch

Solid 2.0 in nine minutes

Better Stack walks through what changed: async in the reactive graph, the new Loading and Errored boundaries, optimistic updates and Start mode.

Open in new tab (opens in a new tab)

Solid 2.0

What's new in Solid 2.0

Solid 2.0 adds async in the reactive graph, draft-based stores and actions for optimistic UI. Edit any example to see it update.

Async reads like a plain value

Async memos read like plain values, even when one depends on another. Pick a state and the old city list stays on screen while the new one loads, the city resets on its own, and no effect keeps them in sync.

Edit the code and the preview updates live.

import { createMemo, createSignal, For, isPending, Loading } from "solid-js";
import { render } from "@solidjs/web";

const CITIES: Record<string, string[]> = {
  California: ["Los Angeles", "San Francisco", "San Diego"],
  Florida: ["Miami", "Orlando", "Tampa"],
  "New York": ["New York City", "Buffalo", "Rochester"],
  Texas: ["Houston", "Dallas", "Austin"],
};

// Stand-ins for network requests.
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
const getStates = async () => (await sleep(500), Object.keys(CITIES));
const getCities = async (state: string) => (await sleep(500), CITIES[state] ?? []);

function App() {
  // Async memos read like plain values, even when one depends on another.
  const states = createMemo(getStates);
  const [state, setState] = createSignal(() => states()[0]);
  const cities = createMemo(() => getCities(state()));
  // A writable signal derived from the list: picking a new state resets the
  // city on its own, with no effect to keep them in sync.
  const [city, setCity] = createSignal(() => cities()[0]);

  return (
    <Loading fallback={<p>Loading…</p>}>
      <select onChange={(e) => setState(e.currentTarget.value)}>
        <For each={states()}>{(name) => <option>{name}</option>}</For>
      </select>{" "}
      <select disabled={isPending(cities)} onChange={(e) => setCity(e.currentTarget.value)}>
        <For each={cities()}>{(name) => <option>{name}</option>}</For>
      </select>
      <p>
        Selection: {city()}, {state()}
      </p>
    </Loading>
  );
}

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

Community

Built in the open

Solid is MIT licensed and developed on GitHub. Questions and help happen on Discord.

  • Discord

    Ask questions and talk with the community and core team.

  • GitHub

    Read the source, file issues and join the discussions.

  • Team and contributors

    Meet the people who build and maintain Solid.

  • Code of Conduct

    How we keep the community welcoming for everyone.

Sponsors

Thank you to our supporters

Sponsors pay for maintainers, infrastructure and events.

Supporters

Blog

Latest from the blog

Releases, roadmaps and community news from the Solid team.

  • Release

    Solid 2.0 - The Long Hold

    Solid 2.0 reaches stable after five years: async in the reactive graph, server functions, diagnostics built for agents, and a smaller API.

  • Solid 2.0

    Async Solid - One Graph, Two Machines

    Part three of a deep dive into how Solid 2.0 handles async: server functions, streaming, live sources, and recovery, all riding the same reactive graph.

  • Solid 2.0

    Async Solid - Write Sync, Run Async

    Part two of a deep dive into how Solid 2.0 handles async: how optimistic writes fall out of the client-side app you already wrote.

Follow Solid news

Release news and community updates land on the blog first, then on our social channels.

Rep Solid with stickers and swag

Shirts, stickers, mugs and more from the Solid Store. All profits go to Solid's Open Collective.

Visit the Solid Store