BASE

Signals

Signals

Web framework / library · Free

A fine-grained reactive state library with framework adapters: it updates dependent values and UI without recomputing the entire tree.

Also known as: preactjs/signals; preact-signals; signals

Resource illustration: Signals

Open resource ↗

What you can use for free

Code and local use under MIT.

Paid features and costs

Computing resources, self-hosting, and external services are paid for separately if used.

Access and limitations

Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.

Use cases

  • Add fine-grained reactive state to a UI
  • Connect derived values and UI to signals and test dependent element updates

Example workflow

A possible workflow; this is not a report of hands-on testing.

Add fine-grained reactive state to a UI.

Before you start

  • Web application source code and the intended workflow.
  • The project's framework and runtime version.

Steps

  1. Define signals for the selected component's state.
  2. Connect derived values and UI to signals and test dependent element updates.
  3. Add real data and error handling; check the production build.

Check your result

  • The workflow works after a page refresh and with invalid data.
  • The bundle, server rendering, and supported browsers suit the project.

Choosing Signals

Add fine-grained reactive state to a UI

Choose this when

  • Add fine-grained reactive state to a UI
  • Connect derived values and UI to signals and test dependent element updates

Requirements

  • In React, connect @preact/signals-react and the Babel transform, or explicitly call useSignals in the reading component.

Things to consider

  • Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
  • Terms of use: MIT for the code; dependencies have separate licenses.
  • React integration does not support passing a signal directly as a DOM attribute; render props require correct tracking of the reading component.

Frequently asked questions

What can you use for free in Signals?

Code and local use under MIT.

What additional costs might arise with Signals?

Computing resources, self-hosting, and external services are paid for separately if used.

What terms of use matter for Signals?

MIT for the code; dependencies have separate licenses.

How do you get started with Signals?

Define signals for the selected component's state. Connect derived values and UI to signals and test dependent element updates. Add real data and error handling; check the production build.

Is the Babel transform mandatory?

It is the recommended automatic tracking path. If the transform is unavailable, the documentation suggests useSignals; useSignal/useComputed/useSignalEffect create local state and computations.

Why might reading a signal through a render prop fail to update the UI?

The component invoking the render prop reads the value, and the transform may not recognize it. The README suggests mode: all or a separate component explicitly reading the signal.

License

MIT for the code; dependencies have separate licenses.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Technologies and topics

  • Signals
  • web
  • Development

Sources

Other resources