---
stable_id: skills/skills-sh-antfu-skills-pinia
type: skills
title: skills-sh-antfu-skills-pinia
summary: >-
  ---

  name: stores

  description: Defining stores, state, getters, and actions in Pinia

  ---

  # Pinia Stores

  Stores are defined using `defineStore()` with a unique name. Each store has
  three core concepts: **state**, **getters**, and **actions**.

  ## Defining Stores

  ### Option Stores

  Similar to Vue's Options API:

  ```ts
tags:
  - skills-sh
  - skills-sh-all-time
source_url: https://raw.githubusercontent.com/antfu/skills/HEAD/skills/pinia/references/core-stores.md
license: ""
upstream_ref: https://skills.sh/antfu/skills/pinia
github_stars: 4218
github_forks: 211
github_is_organization: false
retrieved_at: 2026-06-11T08:33:24.774Z
content_sha256: 41627453eb019d1755dac787924bde52be162a3bdfc555119f88a8e59dda8f21
---
