---
title: "Tutorial: Atom"
description: Declare a count with atom() and show it in JSX.
seo:
  title: Add counter state with atom() - Ilha
---

import { example } from "./atom.examples";

You declare reactive values with `atom()`. Reads during render subscribe the component. Writes rerun it.

<Preview code={example} size="lg" />

## Similar concepts

- React: `useState`
- Vue: `ref()`
- Svelte: `$state()`
