[All situations](/)

# Mostly HTML. A few parts need the same state.

One small store. No SPA, no syncing by hand.

`document.querySelectorAll``addEventListener`

**Pricing**

Starter **$9**Team **$29**

pricing.js · no framework

```
export const $period = atom<Period>('monthly')
$period.subscribe((period) => {
  for (const el of document.querySelectorAll<HTMLElement>('[data-price]')) {
    el.textContent = el.dataset[period] ?? ''
  }
})
toggle.addEventListener('change', () =>
  $period.set(toggle.checked ? 'yearly' : 'monthly'),
)
```

Just one local toggle? Plain JavaScript is enough.

`npm install nanostores`

[Getting started →](/docs/getting-started/)

[No app logic in React hooks →](/for/logic-outside-hooks/)[Two islands need the same data →](/for/islands/)[Persistent Store ↗](https://github.com/nanostores/persistent#readme)
