Footers JS behaviour

Newsletter footer

A newsletter-first footer on a dotted dark ground: a big headline, an email form with live validation and a success note that takes the form’s place — a few sparse columns and the social row below.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

The Meridian letter

Ship notes, straight to your inbox.

One issue a month: release deep-dives, flags we shipped and the postmortems we published. Read by 12,400 product teams.

You’re on the list — the next issue lands on the first Tuesday.

No spam, unsubscribe in one click. See our privacy note.

Important props

Important props
Prop Type Default What it does
validate rule '/^[^@\s]+@[^@\s]+\.[a-z]{2,}$/i' Validates in place on submit; the error lands under the field and the form yields to the success note.
--nlf-dot color 'rgba(255,255,255,.13)' The texture dot colour; a repeating 22px radial-gradient grid over the #0B1120 ground.
heading string 'Ship notes, monthly.' The big heading clamps from 1.75rem to 3rem — the form is this footer’s hero, not the links.
columns array '2' Just two sparse columns (Product, Company) so nothing steals the form’s spotlight.
success slot '' The success note with a check icon; the default copy says when the next issue lands.

Snippet

<footer class="nlf-foot" x-data="{ email: '', error: '', done: false,
          submit() { this.error = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(this.email) ? '' : 'Enter a valid email';
                     if (!this.error) this.done = true } }">
<h3 class="nlf-title">Ship notes, monthly.</h3>
<form class="nlf-form" x-show="!done" x-on:submit.prevent="submit()">
<input type="email" x-model="email" placeholder="you@studio.com" aria-label="Email address">
<button type="submit">Subscribe</button>
<p class="nlf-error" x-show="error" x-text="error"></p>
</form>
<p class="nlf-done" x-show="done" x-cloak>✓ You’re on the list — next issue lands Tuesday.</p>
<nav class="nlf-cols" aria-label="Footer">
<div><h4>Product</h4><a href="#">Feature flags</a><a href="#">Pricing</a></div>
<div><h4>Company</h4><a href="#">About</a><a href="#">Careers</a></div>
</nav>
</footer>

<style>
.nlf-foot { padding: 4rem 1.5rem 2rem; color: #E2E8F0; background-color: #0B1120;
background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.13) 1px, transparent 1.5px);
background-size: 22px 22px; }
.nlf-title { margin: 0; font: 700 clamp(1.75rem, 4vw, 3rem)/1.15 'Inter', sans-serif; }
.nlf-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1.25rem; }
.nlf-form input { flex: 1 1 14rem; block-size: 3rem; padding-inline: 1rem; color: #fff;
background: #131C31; border: 1px solid #26334D; border-radius: .75rem; }
.nlf-form button { block-size: 3rem; padding-inline: 1.5rem; background: #38BDF8; color: #04121F;
font-weight: 700; border: none; border-radius: .75rem; cursor: pointer; }
.nlf-error { flex-basis: 100%; margin: 0; font-size: .8rem; color: #FCA5A5; }
.nlf-done { margin: 1.25rem 0 0; color: #6EE7B7; }
.nlf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem;
margin-block-start: 3rem; padding-block-start: 1.25rem; border-block-start: 1px solid #26334D; }
.nlf-cols h4 { margin: 0 0 .5rem; font-size: .75rem; color: #7C8DB0; }
.nlf-cols a { display: block; padding-block: .2rem; color: #B6C2D9; text-decoration: none; }
.nlf-cols a:hover { color: #fff; }
[x-cloak] { display: none; }
@media (prefers-reduced-motion: reduce) { .nlf-foot * { transition: none; } }
</style>
// app/Pages/Home.jsx — Inertia (React) page; renders the React snippet
// below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import NewsletterFooter from '@/components/NewsletterFooter';

export default function Home() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <main className="nx-page">
        <NewsletterFooter />
      </main>
    </NabuXUIProvider>
  );
}
// NewsletterFooter.jsx — dark dotted footer, validated signup form
import { useState } from 'react';
import '@nabuxai/ui-core/css';

const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;

export default function NewsletterFooter() {
  const [email, setEmail] = useState('');
  const [error, setError] = useState('');
  const [done, setDone] = useState(false);

  const submit = (e) => {
    e.preventDefault();
    if (!EMAIL.test(email)) { setError('Enter a valid email'); return; }
    setError(''); setDone(true);
  };

  return (
    <>
      <style>{`
        .nlf-foot { padding: 4rem 1.5rem 2rem; color: #E2E8F0; background-color: #0B1120;
                    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.13) 1px, transparent 1.5px);
                    background-size: 22px 22px; }
        .nlf-title { margin: 0; font: 700 clamp(1.75rem, 4vw, 3rem)/1.15 'Inter', sans-serif; }
        .nlf-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1.25rem; }
        .nlf-form input { flex: 1 1 14rem; block-size: 3rem; padding-inline: 1rem; color: #fff;
                    background: #131C31; border: 1px solid #26334D; border-radius: .75rem; }
        .nlf-form button { block-size: 3rem; padding-inline: 1.5rem; background: #38BDF8; color: #04121F;
                    font-weight: 700; border: none; border-radius: .75rem; cursor: pointer; }
        .nlf-error { flex-basis: 100%; margin: 0; font-size: .8rem; color: #FCA5A5; }
        .nlf-done { margin: 1.25rem 0 0; color: #6EE7B7; }
        .nlf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem;
                    margin-block-start: 3rem; padding-block-start: 1.25rem; border-block-start: 1px solid #26334D; }
        .nlf-cols h4 { margin: 0 0 .5rem; font-size: .75rem; color: #7C8DB0; }
        .nlf-cols a { display: block; padding-block: .2rem; color: #B6C2D9; text-decoration: none; }
        .nlf-cols a:hover { color: #fff; }
      `}</style>
      <footer className="nlf-foot">
        <h3 className="nlf-title">Ship notes, monthly.</h3>
        {done ? (
          // The form yields to a single success line with a check.
          <p className="nlf-done">✓ You’re on the list — next issue lands Tuesday.</p>
        ) : (
          <form className="nlf-form" onSubmit={submit} noValidate>
            <input type="email" value={email} onChange={(e) => setEmail(e.target.value)}
                   placeholder="you@studio.com" aria-label="Email address" />
            <button type="submit">Subscribe</button>
            {error && <p className="nlf-error" role="alert">{error}</p>}
          </form>
        )}
        <nav className="nlf-cols" aria-label="Footer">
          <div><h4>Product</h4><a href="#">Feature flags</a><a href="#">Pricing</a></div>
          <div><h4>Company</h4><a href="#">About</a><a href="#">Careers</a></div>
        </nav>
      </footer>
    </>
  );
}
<!-- NewsletterFooter.vue — dark dotted footer, validated signup form -->
<script setup lang="ts">
import { ref } from 'vue';
import '@nabuxai/ui-core/css';

const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
const email = ref('');
const error = ref('');
const done = ref(false);

function submit() {
  error.value = EMAIL.test(email.value) ? '' : 'Enter a valid email';
  if (!error.value) done.value = true;
}
</script>

<template>
  <footer class="nlf-foot">
    <h3 class="nlf-title">Ship notes, monthly.</h3>
    <!-- The form yields to a single success line with a check. -->
    <form v-if="!done" class="nlf-form" @submit.prevent="submit" novalidate>
      <input v-model="email" type="email" placeholder="you@studio.com" aria-label="Email address" />
      <button type="submit">Subscribe</button>
      <p v-if="error" class="nlf-error" role="alert">{{ error }}</p>
    </form>
    <p v-else class="nlf-done">✓ You’re on the list — next issue lands Tuesday.</p>
    <nav class="nlf-cols" aria-label="Footer">
      <div><h4>Product</h4><a href="#">Feature flags</a><a href="#">Pricing</a></div>
      <div><h4>Company</h4><a href="#">About</a><a href="#">Careers</a></div>
    </nav>
  </footer>
</template>

<style scoped>
.nlf-foot { padding: 4rem 1.5rem 2rem; color: #E2E8F0; background-color: #0B1120;
            background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.13) 1px, transparent 1.5px);
            background-size: 22px 22px; }
.nlf-title { margin: 0; font: 700 clamp(1.75rem, 4vw, 3rem)/1.15 'Inter', sans-serif; }
.nlf-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1.25rem; }
.nlf-form input { flex: 1 1 14rem; block-size: 3rem; padding-inline: 1rem; color: #fff;
            background: #131C31; border: 1px solid #26334D; border-radius: .75rem; }
.nlf-form button { block-size: 3rem; padding-inline: 1.5rem; background: #38BDF8; color: #04121F;
            font-weight: 700; border: none; border-radius: .75rem; cursor: pointer; }
.nlf-error { flex-basis: 100%; margin: 0; font-size: .8rem; color: #FCA5A5; }
.nlf-done { margin: 1.25rem 0 0; color: #6EE7B7; }
.nlf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem;
            margin-block-start: 3rem; padding-block-start: 1.25rem; border-block-start: 1px solid #26334D; }
.nlf-cols h4 { margin: 0 0 .5rem; font-size: .75rem; color: #7C8DB0; }
.nlf-cols a { display: block; padding-block: .2rem; color: #B6C2D9; text-decoration: none; }
.nlf-cols a:hover { color: #fff; }
</style>
<!-- NewsletterFooter.svelte — dark dotted footer, validated signup form -->
<script lang="ts">
  import '@nabuxai/ui-core/css';

  const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
  let email = $state('');
  let error = $state('');
  let done = $state(false);

  function submit() {
    error = EMAIL.test(email) ? '' : 'Enter a valid email';
    if (!error) done = true;
  }
</script>

<footer class="nlf-foot">
  <h3 class="nlf-title">Ship notes, monthly.</h3>
  <!-- The form yields to a single success line with a check. -->
  {#if !done}
    <form class="nlf-form" onsubmit={submit} novalidate>
      <input bind:value={email} type="email" placeholder="you@studio.com" aria-label="Email address" />
      <button type="submit">Subscribe</button>
      {#if error}<p class="nlf-error" role="alert">{error}</p>{/if}
    </form>
  {:else}
    <p class="nlf-done">✓ You’re on the list — next issue lands Tuesday.</p>
  {/if}
  <nav class="nlf-cols" aria-label="Footer">
    <div><h4>Product</h4><a href="#">Feature flags</a><a href="#">Pricing</a></div>
    <div><h4>Company</h4><a href="#">About</a><a href="#">Careers</a></div>
  </nav>
</footer>

<style>
.nlf-foot { padding: 4rem 1.5rem 2rem; color: #E2E8F0; background-color: #0B1120;
            background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.13) 1px, transparent 1.5px);
            background-size: 22px 22px; }
.nlf-title { margin: 0; font: 700 clamp(1.75rem, 4vw, 3rem)/1.15 'Inter', sans-serif; }
.nlf-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1.25rem; }
.nlf-form input { flex: 1 1 14rem; block-size: 3rem; padding-inline: 1rem; color: #fff;
            background: #131C31; border: 1px solid #26334D; border-radius: .75rem; }
.nlf-form button { block-size: 3rem; padding-inline: 1.5rem; background: #38BDF8; color: #04121F;
            font-weight: 700; border: none; border-radius: .75rem; cursor: pointer; }
.nlf-error { flex-basis: 100%; margin: 0; font-size: .8rem; color: #FCA5A5; }
.nlf-done { margin: 1.25rem 0 0; color: #6EE7B7; }
.nlf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem;
            margin-block-start: 3rem; padding-block-start: 1.25rem; border-block-start: 1px solid #26334D; }
.nlf-cols h4 { margin: 0 0 .5rem; font-size: .75rem; color: #7C8DB0; }
.nlf-cols a { display: block; padding-block: .2rem; color: #B6C2D9; text-decoration: none; }
.nlf-cols a:hover { color: #fff; }
</style>