ASTRO + NANO STORES

Six frameworks.
One shared state.

Type in Vue. Count in Svelte. Pick a color in React.
Every island stays in sync.

One browser. One source of truth.Try any card below.

React

React

useStore() hook

0

Hello islands

Vue

Vue

useStore() composable

0

Hello islands

Svelte

Svelte

Native $store subscription

0

Hello islands

Preact

Preact

useStore() hook

0

Hello islands

SolidJS

SolidJS

useStore() accessor

0

Hello islands

AlpineJS

Alpine

subscribe() with Alpine.data()

0

Hello islands

THE SAME STATE, PLAIN JAVASCRIPT

Astro is listening too.

Astro + browser script

Hello islands · count 0 · doubled 0

How it works Small stores. Native subscriptions.

Each island imports the same store module. Updating an atom notifies its subscribers across framework boundaries. Computed stores derive new values from that state.

Define state once

import { atom, computed } from 'nanostores';

export const count = atom(0);
export const doubled = computed(count, value => value * 2);

count.set(count.get() + 1);

Read it in React

import { useStore } from '@nanostores/react';
import { count } from '../stores/playground';

const currentCount = useStore(count);

Use Svelte's store contract

<script>
  import { count } from '../stores/playground';
</script>

<output>{$count}</output>

Subscribe with plain JavaScript

import { count } from '../stores/playground';

const unsubscribe = count.subscribe(value => {
  output.textContent = String(value);
});

// Call unsubscribe() when the element is removed.

Preact, Vue and Solid use their Nano Stores adapters. Alpine uses the same subscribe() API as the Astro readout. The source keeps each card separate so you can compare the implementations.