🔥 All-Access Pass — $199 USD (Regular $499) · Unlock all 2,836 Astro themes ➔
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
CMS & Integrations••By Komal Nakrani

The Best Astro Integrations for Real Sites (2026)

The best Astro integrations, grouped by job: MDX, sitemap, UI frameworks, adapters, Tailwind CSS, icons, code blocks, search, compression and Partytown.

#Astro#Astro Integrations#Plugins#Tooling

The Astro integrations most production sites actually use are @astrojs/mdx for components in Markdown, @astrojs/sitemap for SEO, a UI framework integration such as @astrojs/react when you need interactive islands, and an adapter (@astrojs/node, @astrojs/cloudflare, @astrojs/netlify or @astrojs/vercel) when pages render on demand. Beyond those, a handful of community packages cover icons, code blocks, search and compression. Most sites need four to six integrations, not twenty.

This list groups the integrations worth knowing by the job they do, with the install command and what each one adds, current for Astro 7.

Key Takeaways

  • Install integrations with npx astro add <name>; it updates package.json and astro.config.mjs in one step.
  • Official integrations live under @astrojs/* and are upgraded together with npx @astrojs/upgrade.
  • Tailwind CSS 4 is set up as a Vite plugin, not the old @astrojs/tailwind integration.
  • Some things that used to need integrations are now built in: images, fonts, SVG components and prefetch.
  • Every integration adds build time and upgrade work. Add one when a page needs it.

How Astro integrations work

An integration is a package that hooks into Astro’s build: it can add renderers, routes, Vite plugins, scripts or files to the output. You install one with the CLI:

# terminal
npx astro add mdx sitemap

That installs the packages and registers them:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
  site: 'https://www.example.com',
  integrations: [mdx(), sitemap()],
});

Order rarely matters, but some integrations document a required position. The full directory is at astro.build/integrations.

Content integrations

@astrojs/mdx

Lets .mdx files use components, imports and JavaScript expressions alongside Markdown. It’s the most installed Astro integration for a reason: callouts, embeds, tabs and interactive demos in posts all depend on it. MDX files work in content collections and as pages. MDX inherits your markdown.processor settings by default. Our Astro MDX guide covers custom components and layouts.

# terminal
npx astro add mdx

@astrojs/markdoc

An alternative to MDX for teams that want content authors to use tags without writing JavaScript. Markdoc separates content from code more strictly, which suits large documentation teams.

Starlight

Astro’s official documentation framework, installed as an integration (@astrojs/starlight). It adds navigation, search, i18n, dark mode and page layouts for docs sites. Start a new project with it rather than adding it to an existing marketing site, unless docs live under a subpath. See Astro or Starlight for docs.

SEO integrations

@astrojs/sitemap

Generates sitemap-index.xml and sitemap files on every build from your static routes. Requires site in your config. Supports filter, serialize for lastmod, and i18n alternates. Covered in the Astro sitemap tip.

// astro.config.mjs
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
  site: 'https://www.example.com',
  integrations: [
    sitemap({ filter: (page) => !page.includes('/thank-you/') }),
  ],
});

@astrojs/rss

Not an integration, but the official package for feeds. You call it from an endpoint such as src/pages/rss.xml.js. Install it with npm install @astrojs/rss.

UI framework integrations

Each one adds a renderer so components from that framework can render in Astro and hydrate as islands:

Integration Install Notes
@astrojs/react npx astro add react Most common; needs include if mixed with Preact or Solid
@astrojs/preact npx astro add preact Smaller runtime with a React-like API
@astrojs/vue npx astro add vue Single-file components
@astrojs/svelte npx astro add svelte Small runtime, compiled components
@astrojs/solid-js npx astro add solid Fine-grained reactivity
@astrojs/alpinejs npx astro add alpinejs Alpine directives in plain HTML, no islands needed

Install one only when you need components from that ecosystem. For small interactions, a <script> tag in an Astro component is lighter. Our guide to React in Astro covers hydration and shared state.

Adapters for on-demand rendering

Adapters let Astro render pages per request. A purely static site needs none.

Adapter Install Runs on
@astrojs/node npx astro add node Any Node.js server or container
@astrojs/cloudflare npx astro add cloudflare Cloudflare Workers
@astrojs/netlify npx astro add netlify Netlify Functions and Edge Functions
@astrojs/vercel npx astro add vercel Vercel Functions

With an adapter, you can mix static and dynamic routes: prerender most pages and set export const prerender = false on the few that need request data. Server islands, actions and sessions all depend on an adapter. Our Astro adapters explained article compares them.

Styling integrations

Tailwind CSS

Tailwind CSS 4 integrates through its Vite plugin. npx astro add tailwind sets that up for you:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import tailwindcss from '@tailwindcss/vite';

export default defineConfig({
  vite: { plugins: [tailwindcss()] },
});

Then add @import "tailwindcss"; to a global stylesheet. The older @astrojs/tailwind integration was for Tailwind 3 and is deprecated. The Tailwind CSS setup guide has the details.

Developer experience integrations

astro-expressive-code

Replaces the default code highlighting with frames, titles, line markers, diffs, copy buttons and light/dark themes. Starlight uses it internally. Good for technical blogs and docs.

# terminal
npx astro add astro-expressive-code

Place it before mdx() in the integrations array so it can process MDX code blocks.

astro-icon

Renders icons from local SVG files and any Iconify icon set as inline SVG at build time, with no client JavaScript. See our roundup of Astro icon options for alternatives.

Performance integrations

@astrojs/partytown

Moves third-party scripts such as analytics and tag managers into a web worker, so they don’t block the main thread. Add type="text/partytown" to the scripts you want moved. Test carefully: scripts that need synchronous DOM access may break.

# terminal
npx astro add partytown

Compression

Astro already minifies JavaScript and CSS and, by default, collapses whitespace in HTML. Community packages such as @playform/compress go further, compressing HTML, SVG and images after the build. Measure first; the gain on a site that’s already lean may be small.

Search integrations

Pagefind indexes your built HTML and runs search entirely in the browser, with no server or third-party service. Community integrations such as astro-pagefind run the indexer after astro build. It’s the default choice for static blogs and docs; Starlight includes it out of the box. Our Pagefind search guide shows the setup.

What you no longer need an integration for

Several features that once required packages are built into Astro 7:

  • Image optimization: <Image /> and <Picture /> from astro:assets.
  • Fonts: the top-level fonts config option downloads, self-hosts and preloads fonts.
  • SVG components: import an .svg file and render it as a component.
  • Prefetching: the prefetch config option.
  • View transitions: <ClientRouter /> from astro:transitions.
  • Type-safe environment variables: the env config option with envField.

If a tutorial tells you to install a package for one of these, check the date. It’s probably written for an older version.

How to choose Astro integrations

  1. Start with none. A fresh Astro site with Content Collections, images and fonts needs nothing extra.
  2. Add MDX and sitemap for almost any content site.
  3. Add one UI framework only when you have interactive components to build or reuse.
  4. Add an adapter only when a route needs the request (forms with actions, auth, personalized pages).
  5. Prefer official @astrojs/* packages when one exists. They’re released alongside Astro and updated by the upgrade tool.
  6. Check maintenance for community packages: recent releases, open issues, and compatibility with your Astro major version.

Komal themes start from this minimal set (most use Tailwind CSS 3 and the sitemap integration, with no UI framework), so you add integrations only when a page needs them; browse Astro themes or see the astro.config docs for how they’re configured. The official integrations guide covers manual installation and removal.

FAQ

What are Astro integrations?

Integrations are packages that extend Astro’s build. They can add UI framework renderers, server adapters, routes, Vite plugins, scripts or generated files such as sitemaps. You register them in the integrations array in astro.config.mjs.

How do I install an Astro integration?

Run npx astro add <name>, for example npx astro add mdx. The command installs the package and adds it to astro.config.mjs. You can also install it with npm and add it to the config by hand.

How do I remove an Astro integration?

Delete it from the integrations array in astro.config.mjs, remove its import, then run npm uninstall <package>. Check for components or config that still depend on it before rebuilding.

Is @astrojs/tailwind still needed?

No. Tailwind CSS 4 uses the @tailwindcss/vite plugin, which npx astro add tailwind configures. The @astrojs/tailwind integration was for Tailwind 3 and is deprecated.

Do Astro integrations slow down my site?

Integrations mostly run at build time, so they add build time rather than page weight. UI framework integrations add client JavaScript only for components you hydrate, and Partytown adds a small worker script.