experiment_id: web-retrieval-v1
fixture_id: /docs/integrations/js-frameworks-&-libs/astro
mode: provenance
representation: html
origin_response_id: fbcf88198b5e98d597ce96c02107cc94
version: 2026-10-21
version_created_at_utc: 2026-10-21T20:42:35.728Z
version_nonce: 770956bea504d3171aae1c5c33fec95c
generated_at_utc: 2026-11-15T00:04:45.204Z
response_nonce: 258fb9387ee0175b94930398db66c63f
Docs Version 1

Astro Integration

ZingGrid works with your development stack, including Astro! In this guide, we'll walk you through how to add ZingGrid to your Astro project.

Usage

  1. For this example we'll start with a new Astro app:

    npm create astro@latest

    You can now view the app in a browser at localhost:3000.

  2. First, include the ZingGrid library (prferably deferred) in src/layouts/Layout.astro:

    <!-- ... -->
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="description" content="Astro description" />
        <meta name="viewport" content="width=device-width" />
        <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
        <meta name="generator" content={Astro.generator} />
        <title>{title}</title>
        <!-- ZingGrid Library -->
    	  <script is:inline defer src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
      </head>
      <body>
        <slot />
      </body>
    </html>
    <!-- ... -->
  3. Then create a component in src/components/Grid.astro with ZingGrid in it that will have a data prop to allow us to pass data to the grid.

    ---
    const { data } = Astro.props;
    ---
    
    <zing-grid data={data}></zing-grid>
  4. Then, let's add the grid component to src/pages/index.astro and pass data to it. Run npm run dev to preview your Astro app!

    ---
    import Grid from '../components/Grid.astro';
    import Layout from '../layouts/Layout.astro';
    
    const myData = JSON.stringify([{"name": "Oreo","breed":"Mastiff"}, {"name": "Buddy","breed":"Greate Dane"}, {"name": "Max","breed":"Doodle"}]);
    ---
    
    <Layout>
    <header> <!-- ... --> </header>
      <main>
        <Grid data={myData} />
      </main>
    </Layout>

For more details on integrating ZingGrid into a Astro app, see the articles below:

Top

[integrations: astro]

On This Page