🔥 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)
Astro Themes••By Komal Nakrani

Coming Soon Page in Astro: Build One with a Waitlist

Build a coming soon page in Astro: a one-page layout, a countdown in a small script, a waitlist form that works on static hosting, and SEO settings for launch.

#Astro#Coming Soon Page#Landing Pages#Forms

To build a coming soon page in Astro, create one src/pages/index.astro with a headline, a launch date and a waitlist form, add a few lines of client-side script for an optional countdown, and post the form to a form backend so the page stays fully static. Astro ships no JavaScript by default, so the page loads fast on any free static host, and you replace it with the real site later without changing hosts.

Key Takeaways

  • A coming soon page in Astro is a single static page; it needs no adapter or server.
  • Collect emails with a form backend or newsletter provider, or with an Astro Action if you add an adapter.
  • Keep the countdown in a plain <script> tag instead of a framework island.
  • Let the page be indexed, give it a real title and description, and keep the same domain for launch.
  • Swap the page for the full site later by replacing src/pages/index.astro.

What a coming soon page needs

A good pre-launch page does four jobs: say what is coming, say when, collect interest, and look credible enough that people trust you with their email. Everything else is optional.

Section Purpose Needs JavaScript?
Headline and one-line pitch Explains the product or site No
Launch date or “launching in” Sets expectations Only for a live countdown
Waitlist or email form Collects leads No, a plain HTML form works
Social or contact links Gives a second way to follow No
Short FAQ or feature list Answers obvious questions No

Because none of the core pieces need client-side code, the page can ship as pure HTML and CSS. That matters on launch day, when a link shared on social media can send a burst of traffic to a page that must not fall over.

Set up the Astro project

Start from the minimal template. It gives you one page and nothing to delete:

npm create astro@latest -- --template minimal coming-soon
cd coming-soon
npm run dev

Set your production URL in the config now. Astro uses site for canonical URLs and the sitemap, and you’ll want both pointing at the real domain from the first day:

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

export default defineConfig({
  site: 'https://example.com',
});

If you want Tailwind CSS, run npx astro add tailwind. Plain CSS in a <style> tag is enough for a single page.

Build the coming soon page layout

Put the shared <head> in a layout so the real site can reuse it later. Keep the title and description specific; this is what search results and link previews show.

---
// src/layouts/Base.astro
interface Props {
  title: string;
  description: string;
}
const { title, description } = Astro.props;
const canonical = new URL(Astro.url.pathname, Astro.site);
---
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>{title}</title>
    <meta name="description" content={description} />
    <link rel="canonical" href={canonical} />
    <meta property="og:title" content={title} />
    <meta property="og:description" content={description} />
    <meta property="og:url" content={canonical} />
  </head>
  <body>
    <slot />
  </body>
</html>

Then the page itself. The launch date lives in one constant so the visible text and the countdown never disagree:

---
// src/pages/index.astro
import Base from '../layouts/Base.astro';

const launch = new Date('2027-01-15T09:00:00Z');
const launchLabel = launch.toLocaleDateString('en-US', {
  month: 'long',
  day: 'numeric',
  year: 'numeric',
  timeZone: 'UTC',
});
---
<Base
  title="Fieldnote: Notes for Field Researchers, Launching January 2027"
  description="Fieldnote is an offline-first notebook for field researchers. Join the waitlist to get early access when it launches in January 2027."
>
  <main class="wrap">
    <p class="eyebrow">Launching {launchLabel}</p>
    <h1>Field notes that sync when you get back to signal.</h1>
    <p class="lede">Fieldnote is an offline-first notebook for researchers who work far from Wi-Fi.</p>

    <p class="countdown" data-launch={launch.toISOString()} aria-live="polite">
      Launching {launchLabel}
    </p>

    <form class="waitlist" method="POST" action="https://forms.example.com/f/your-form-id">
      <label for="email">Email address</label>
      <input id="email" name="email" type="email" required autocomplete="email" />
      <input type="text" name="_gotcha" tabindex="-1" autocomplete="off" hidden />
      <button type="submit">Join the waitlist</button>
    </form>
  </main>
</Base>

<style>
  .wrap { max-width: 36rem; margin: 0 auto; padding: 6rem 1.5rem; }
  .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
  h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; }
  .waitlist { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
  .waitlist label { flex-basis: 100%; }
  .waitlist input[type='email'] { flex: 1 1 16rem; padding: 0.75rem; }
</style>

The _gotcha field is a common honeypot name that many form backends use to drop bot submissions; check what your provider expects. The countdown paragraph already contains readable text, so the page makes sense before any script runs.

Add a countdown without a framework

A countdown is a few lines of DOM code. Astro processes and bundles a <script> tag in a component, so there’s no need to hydrate a React or Svelte island for it:

---
// src/components/Countdown.astro (or inline at the bottom of index.astro)
---
<script>
  const el = document.querySelector<HTMLElement>('.countdown');
  const target = el ? new Date(el.dataset.launch ?? '').getTime() : NaN;

  function tick() {
    if (!el || Number.isNaN(target)) return;
    const ms = target - Date.now();
    if (ms <= 0) {
      el.textContent = 'We have launched.';
      return;
    }
    const days = Math.floor(ms / 86_400_000);
    const hours = Math.floor((ms / 3_600_000) % 24);
    const minutes = Math.floor((ms / 60_000) % 60);
    el.textContent = `Launching in ${days} days, ${hours} hours, ${minutes} minutes`;
  }

  tick();
  setInterval(tick, 60_000);
</script>

Updating once a minute is plenty for a launch page and avoids a screen reader announcing a new value every second through aria-live. If you want seconds, drop aria-live from the element. The script tag guide explains how Astro bundles these scripts and when to reach for an island instead.

Collect waitlist emails

You have three practical options, and only one of them needs a server.

A form backend

Services like Formspree, Basin, Web3Forms or Netlify Forms accept a plain HTML POST and store or email the submissions. This keeps the coming soon page static and works on every host. Our form backends comparison covers the trade-offs.

A newsletter provider’s embed

If you’ll email the list at launch anyway, post the form straight to your newsletter tool. Most providers give you a form action URL and the field names to use. The newsletter signup tip walks through the setup.

An Astro Action

If you want submissions in your own database, add an adapter and define an Action. The page that handles the form must be rendered on demand:

// src/actions/index.ts
import { defineAction } from 'astro:actions';
import { z } from 'astro/zod';

export const server = {
  waitlist: defineAction({
    accept: 'form',
    input: z.object({ email: z.email() }),
    handler: async ({ email }) => {
      // save the address to your database or mailing list API here
      return { email };
    },
  }),
};
---
// src/pages/index.astro (on-demand version)
import { actions } from 'astro:actions';
export const prerender = false;
const result = Astro.getActionResult(actions.waitlist);
---
<form method="POST" action={actions.waitlist}>
  <input name="email" type="email" required />
  <button>Join the waitlist</button>
</form>
{result && !result.error && <p>Thanks, you're on the list.</p>}

Without an adapter, Astro stops the build with “Actions must be used with server output.” For a single email field, a form backend is usually less work. The official Actions docs list every option.

SEO for a pre-launch page

A coming soon page is often the first URL search engines see for a new domain. Treat it as a real page:

  1. Let it be indexed. A noindex tag on the only page means the domain builds no history before launch. Leave indexing on unless the project is confidential.
  2. Use the real brand name in the <title> and <h1>. People who hear about the product will search for it.
  3. Keep the domain and the root URL. Launch the full site on the same domain, with the homepage at /, so links people shared keep working.
  4. Add a sitemap with npx astro add sitemap once you have more than one page.
  5. Avoid a 503 status for a long pre-launch period. That status is meant for short maintenance windows, while a static page returns 200, which is what you want here.

Before you switch to the full site, recheck titles, redirects and the sitemap.

Deploy it

Run npm run build and you get a dist/ folder with one HTML file and its assets. Connect the repository to Cloudflare Pages, Netlify, Vercel or GitHub Pages, set the build command to npm run build and the output directory to dist. The static deploy docs cover each host’s settings.

On launch day, replace src/pages/index.astro with the real homepage, keep the layout, and push. Visitors who saved the coming soon URL land on the live site with nothing to redirect.

Start from a coming soon theme

If you’d rather start from a designed page than a blank file, the Launch & Coming Soon category is small, but it holds options like Crafters, which ships several coming soon page variants as editable Astro source. Comingable offers a set of landing page layouts you can mix and match. Both build to static output, so the deploy steps above apply unchanged.

FAQ

How do I make a coming soon page in Astro?

Create a single src/pages/index.astro with your headline, launch date and an email form, then run npm run build and deploy the dist/ folder to a static host. Post the form to a form backend so you don’t need a server.

Should a coming soon page be indexed by Google?

In most cases, yes. Indexing the page lets the domain and brand name start appearing in search before launch. Only add noindex if the project is confidential and you don’t want it found yet.

Can I collect emails on a static Astro site?

Yes. A plain HTML form can post to a form backend or a newsletter provider, which stores the submissions for you. You only need an adapter if you want to process submissions with your own code, for example through an Astro Action.

How do I add a countdown timer to an Astro page?

Put the launch date in a data- attribute, then add a <script> tag that reads it and updates the element’s text on an interval. Astro bundles the script automatically, so no framework island is needed.

How do I switch from the coming soon page to the full site?

Replace src/pages/index.astro with the real homepage and add the other pages alongside it. Keep the same domain and root URL so shared links and any early search rankings carry over.