# createKeyValueStateStorage (@salmonui/data/storage)

> The createKeyValueStateStorage function of @salmonui/data/storage: Key-value storage. The store is injected (never localStorage directly). Versions are a counter kept beside the state, so expectedVersion detects a concurrent save from another tab.

Canonical: https://salmonui.dev/docs/reference/data/storage/createKeyValueStateStorage

```ts
import { createKeyValueStateStorage } from '@salmonui/data/storage';
```

Also exported from `@salmonui/data`.

Entry index: https://salmonui.dev/docs/reference/data/storage (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data/storage.md).

## Reference

Kind: function

```ts
function createKeyValueStateStorage(store: KeyValueStore, options?: {
    readonly prefix?: string;
}): DataGridStateStorage;
```

Key-value storage. The store is injected (never `localStorage` directly).
Versions are a counter kept beside the state, so `expectedVersion` detects
a concurrent save from another tab.
