---
id: "packages/active-grid/api/resolve-initial-state"
title: "GridStatePriority"
description: "GridStatePriority: generated from the source of active-grid."
url: "/packages/active-grid/api/resolve-initial-state"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:resolve-initial-state"
---

# GridStatePriority

Exported by `@workspace/active-grid`. Generated from the package source; part of [the index of every export](/packages/active-grid/api).

## Types

**GridStatePriority**

```ts
type GridStatePriority =
  'url-first' | 'localstorage-first' | 'url-only' | 'localstorage-only';
```

Conflict-resolution strategy between the two external state sources — the
URL (`enableUrlSync`) and localStorage (`enablePersistence`) — for the
four *contested* state slices. See {@link CONTESTED_SLICES}.

The strategy is per-slice, not per-source-block: each contested slice is
resolved independently, so a URL that carries `sorting` but not
`columnFilters` lets localStorage supply the filters while the URL still
wins the sort. This per-slice independence is the core of the design;
a per-source-block merge cannot express it.

- `url-first` (default) — URL wins when it carries the slice, else
localStorage fills, else the feature default. URL is explicit intent
(bookmark, shared link); localStorage is implicit memory.
- `localstorage-first` — localStorage wins when present, else URL fills,
else the feature default.
- `url-only` — contested slices come from the URL only; localStorage is
ignored for them. Note this does NOT disable persistence for the
column-shape slices (visibility/order/sizing/pinning) — those live
only in localStorage and are unaffected by the strategy.
- `localstorage-only` — contested slices come from localStorage only; the
URL is ignored for them.
