Framework500K+/wkMIT

gatsby

Gatsby is a React-based static site generator and framework that leverages GraphQL for data management and produces blazing-fast websites. It pioneered the conc

Installation

npm
npm install gatsby react react-dom
yarn
yarn add gatsby react react-dom
pnpm
pnpm add gatsby react react-dom

Import

ESM
import { graphql } from 'gatsby';

Quick Example

usage
export default function IndexPage() {
  return (
    <main>
      <h1>Hello Gatsby</h1>
    </main>
  );
}

About gatsby

Gatsby is a React-based static site generator and framework that leverages GraphQL for data management and produces blazing-fast websites. It pioneered the concept of pulling data from any source — CMSs, APIs, databases, markdown files, or the filesystem — through a unified GraphQL data layer at build time. Gatsby generates fully static HTML pages that hydrate into interactive React applications on the client, providing excellent initial load performance and SEO. The framework includes built-in image optimization through gatsby-plugin-image, prefetching of linked pages for instant navigation, and an extensive plugin ecosystem with thousands of plugins for integrating data sources, analytics, styling, and third-party services. Gatsby supports incremental builds through Deferred Static Generation (DSG) and Server-Side Rendering for dynamic content. While Gatsby was the dominant React static site generator for years, competition from Next.js and Astro has shifted its position. It remains excellent for content-heavy websites, blogs, documentation sites, and marketing pages where build-time rendering and the GraphQL data layer provide clear advantages.

Quick Facts

Packagegatsby
CategoryFramework
Weekly Downloads500K+
LicenseMIT
Installnpm install gatsby react react-dom

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.