Skip to content

Newsletter sign-up box in React

A sign-up box with an email field, a button and a note on how the address is used.

Here is an excerpt of this component's code in React. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in React

NewsletterBox.tsx
export function NewsletterBox() {
  return (
    <section className="mx-auto w-[min(100%_-_2rem,40rem)] py-8">
      <section className="rounded-[22px] bg-amber-100 p-6 md:p-10 dark:bg-[#2a2207]">
        <h2 className="mb-2 font-serif text-3xl">La sélection du libraire</h2>
        <p className="leading-relaxed text-[#5e4b12] dark:text-[#e5d394]">
          Chaque premier jeudi du mois, cinq livres coup de cœur et les dates de nos rencontres
          d'auteurs.
        </p>
        <form action="#inscription" method="post" className="mt-6 mb-3 grid gap-1.5">
          <label htmlFor="news-email" className="font-semibold">
            Adresse e-mail

Free component: copy it freely, including for commercial projects.

Calls to action components in React
  • A promotional card for a course, a workshop or an opening: remaining seats, a fill bar, the registration deadline and a booking button, with no countdown timer.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A Free quote within 24 hours banner with a request button, a clickable phone number and three guarantees (no commitment, fast reply, free visit), with no JavaScript.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A desktop contact card with a clickable tel: number, a live Available badge and response hours, for tradespeople who want to be phoned directly.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A call to action for a limited offer: serif heading, two links and a countdown in days, hours and minutes inside a coupon-style frame.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A direct-call block for emergencies, with the number in very large type and response times.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A full-width band with a heading, a sentence and two action buttons.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component