{
 "kind": "tool",
 "slug": "pinia",
 "path": "tools/pinia/",
 "name": "Pinia",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "State and data fetching",
   "tools/state-data/"
  ]
 ],
 "lead": "Intuitive, type-safe state management store for Vue applications.",
 "chips": [
  {
   "label": "State and data fetching",
   "path": "tools/state-data/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install pinia"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/vuejs/pinia"
  },
  {
   "label": "Website",
   "href": "https://pinia.vuejs.org"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/vuejs/pinia"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "Latest GitHub release Oct 14, 2026. ",
   "src": "https://github.com/vuejs/pinia"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "56 projects",
   "status": "info",
   "sub": "#4 of 53 in its category",
   "note": "Dependency in 56 public GitHub projects set up for AI coding agents that we scanned (0.9%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community skills",
   "status": "info",
   "sub": "1 skills by others",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Pinia does",
   "parts": [
    {
     "t": "prose",
     "text": "Pinia is the Vue store the README names as the successor of Vuex: in place of dynamic modules, which the README calls not type safe, you write separate stores in separate files, and the website says their types are inferred even in plain JavaScript."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Pinia popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "67",
       "of": "/ 100",
       "l": "Gid Score, #544 overall"
      },
      {
       "n": "7.9M",
       "l": "downloads a week, npm"
      },
      {
       "n": "14.8K",
       "l": "GitHub stars"
      },
      {
       "n": "56",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Pinia is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Pinia is a dependency in 56 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.2% of the 4,867 JavaScript/TypeScript ones), #4 of 53 in state and data fetching.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 105; those are left out of every share on this page.",
      "The most used alternative in our scan is Zustand (366 projects).",
      "Projects that use it most often also use Vue (98.2%), vue-tsc (69.6%), Vite (69.6%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "30 projects, 1.0%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "28 projects, 0.9%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "23 projects, 0.9%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "7 projects, 2.0%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "6 projects, 1.3%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 98.2% of its projects",
       "v": "Vue",
       "path": "tools/vue/"
      },
      {
       "l": "In 69.6% of its projects",
       "v": "vue-tsc",
       "path": "tools/vue-tsc/"
      },
      {
       "l": "In 69.6% of its projects",
       "v": "Vite",
       "path": "tools/vite/"
      },
      {
       "l": "In 53.6% of its projects",
       "v": "VueUse",
       "path": "tools/vueuse-core/"
      },
      {
       "l": "In 80.4% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 33.9% of its projects",
       "v": "Day.js",
       "path": "tools/dayjs/"
      },
      {
       "l": "In 33.9% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      },
      {
       "l": "In 66.1% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Pinia in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Autocompletion without writing types",
       "v": "The website says store types are inferred. It claims this gives you autocompletion \"even in JavaScript\", not only in TypeScript."
      },
      {
       "l": "One store per file, as many as you need",
       "v": "The README says you can create as many stores as you want. It says each one should live in a different file."
      },
      {
       "l": "Store names show up in devtools",
       "v": "The first argument to <code>defineStore</code> is the store's name. The README says the name must be unique across the application and that it appears in devtools."
      },
      {
       "l": "About 1.5kb, by the site's count",
       "v": "The website says Pinia weighs ~1.5kb. It does not say whether that figure is minified or gzipped."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Vue 2 lives on another branch",
       "v": "The README says the latest pinia works with Vue 3. For Vue 2, it points to the <code>v2</code> branch."
      },
      {
       "l": "No dynamic modules",
       "v": "The README says dynamic modules are not type safe. Instead, the maintainers allow creating different stores that can be imported anywhere."
      },
      {
       "l": "Install command names two packages",
       "v": "The README's install command adds <code>@vue/devtools-api</code> alongside <code>pinia</code>."
      }
     ]
    },
    {
     "t": "h3",
     "text": "A store with state, getters and actions"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Ts",
       "code": "import { defineStore } from 'pinia'\n\n// main is the name of the store. It is unique across your application\n// and will appear in devtools\nexport const useMainStore = defineStore('main', {\n  // a function that returns a fresh state\n  state: () => ({\n    counter: 0,\n    name: 'Eduardo',\n  }),\n  // optional getters\n  getters: {\n    // getters receive the state as first parameter\n    doubleCounter: (state) => state.counter * 2,\n    // use getters in other getters\n    doubleCounterPlusOne(): number {\n      return this.doubleCounter + 1\n    },\n  },\n  // optional actions\n  actions: {\n    reset() {\n      // `this` is the store instance\n      this.counter = 0\n    },\n  },\n})"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Pinia",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/posva",
        "Own page: https://www.paypal.me/posva",
        "42 GitHub sponsors"
       ]
      },
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "pinia: Pinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or impl"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "vue: UI framework",
        "vue-tsc: Type checking for .vue files",
        "vite: Build tool and dev server",
        "@vueuse/core: Vue composition utilities",
        "eslint: Linter",
        "dayjs: Date library"
       ]
      },
      {
       "title": "More in State and data fetching",
       "path": "tools/state-data/",
       "items": [
        {
         "text": "TanStack Query",
         "path": "tools/tanstack-react-query/"
        },
        {
         "text": "RxJS",
         "path": "tools/rxjs/"
        },
        {
         "text": "SWR",
         "path": "tools/swr/"
        },
        {
         "text": "nuqs",
         "path": "tools/nuqs/"
        },
        {
         "text": "Immer",
         "path": "tools/immer/"
        },
        {
         "text": "React Redux",
         "path": "tools/react-redux/"
        },
        {
         "text": "Redux Toolkit",
         "path": "tools/reduxjs/"
        },
        {
         "text": "Lit Signals",
         "path": "tools/lit-labs-signals/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Pinia",
       "me": true,
       "facts": [
        "MIT",
        "Gid 67",
        "7.9M/wk"
       ]
      },
      {
       "name": "Zustand",
       "why": "Lightweight state management for React with minimal boilerplate.",
       "path": "tools/zustand/",
       "facts": [
        "MIT",
        "Gid 88",
        "96.9M/wk"
       ]
      },
      {
       "name": "Jotai",
       "why": "Minimal React state management with atoms as primitive building blocks for flexibility.",
       "path": "tools/jotai/",
       "facts": [
        "MIT",
        "Gid 72",
        "11M/wk"
       ]
      }
     ],
     "more": "Compare Pinia with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install pinia"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Pinia\n- Install with the README's command: `npm install pinia @vue/devtools-api`. pnpm or yarn also work.\n- Create a pinia (the root store) with `createPinia()` and pass it to the app with `app.use(pinia)`.\n- Put each store in its own file. Define it with `defineStore('name', {...})`, and keep the name unique across the app, because it appears in devtools.\n- Write `state` as a function that returns a fresh state. Getters and actions are optional. Getters receive the state as their first parameter, and inside actions `this` is the store instance.\n- `defineStore` returns a function. Call it, for example `useMainStore()`, to get access to the store.\n- To extract specific state or getters from a store, use `storeToRefs(store)`, as the README does.\n- Do not reach for dynamic modules. Create separate stores and import them where needed. The latest version targets Vue 3; for Vue 2, use the `v2` branch.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm pinia"
  ],
  [
   "Category",
   "State and data fetching"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "@pinia/nuxt@1.0.2, August 12, 2026"
  ],
  [
   "On GitHub since",
   "November 2019"
  ],
  [
   "Gid Score",
   "67.1"
  ],
  [
   "Rank in category",
   "#4 of 53"
  ],
  [
   "GitHub",
   "vuejs/pinia"
  ],
  [
   "Last change",
   "Nov 23, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/vuejs.png"
}