# Installation (/en/docs/react/installation)



## Install the package [#install-the-package]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```sh
    npm install @ishibashi0112/spreadsheet-grid
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```sh
    pnpm add @ishibashi0112/spreadsheet-grid
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```sh
    yarn add @ishibashi0112/spreadsheet-grid
    ```
  </CodeBlockTab>
</CodeBlockTabs>

**react** and **react-dom** `^18.3.0 || ^19.0.0` are peer dependencies (your app must have them installed). The runtime dependency `@tanstack/virtual-core` (the framework-agnostic core of TanStack Virtual) and the grid's own framework-agnostic core, `@ishibashi0112/spreadsheet-grid-core`, are installed automatically (the core is pinned to the same version as the React package). You don't need to import them in your app. Supported browsers are listed in the [introduction](/en/docs#supported-browsers).

On React 18, if you wrap the grid in your own function component and pass it a `ref`, make the wrapper a `forwardRef` ([Notes for React](/en/docs/react/notes#ref-and-react-18--19)).

## Load the styles [#load-the-styles]

The grid's CSS ships as a separate file. Import it once, for example in your app's entry point.

```ts
import '@ishibashi0112/spreadsheet-grid/style.css'
```

The base styles are plain (unlayered) CSS scoped to `.ssg-*` classes, and the design tokens are defined with zero specificity (`:where(.ssg-root)`). So **your overrides always win, whatever the import order**. How to load it together with Tailwind CSS and others is in [Loading the CSS and coexistence](/en/docs/css).

## Parts loaded on demand [#parts-loaded-on-demand]

The column filter popover and the tool panel (filter management / column visibility / column order) are split into separate chunks and are not part of the initial load (the JS loaded up front is about 10% smaller). Nothing to configure: any bundler that supports dynamic `import()` (Vite / webpack / Next.js / Rollup / esbuild and others) handles it as is.

* After the grid appears, it preloads these parts when the browser is idle (only when the feature can be used).
* If one is opened before the preload, it loads right then and appears when the load finishes.
* To load them ahead of time, for example before a page transition, call `preloadGridPopups()` (usually not needed). For use in tests, see [Testing](/en/docs/guides/testing#tests-that-open-popovers).

```ts
import { preloadGridPopups } from '@ishibashi0112/spreadsheet-grid'

void preloadGridPopups()
```

## Next steps [#next-steps]

* [Quick start](/en/docs/react/quick-start): run a minimal example
* [Notes for React](/en/docs/react/notes): `ref` on React 18 / 19, using a new row right away, testing
* [Next.js and SSR](/en/docs/react/nextjs): the `'use client'` boundary in the App Router
