Forms & inputs / Forms

Glass Email Capture Pill

Pill-shaped frosted input (blur 20px) with placeholder text and embedded periwinkle submit button, paired with a separate glass secondary pill button.

Rebuilt from mercury.com/releases in the Twilight Ledger style.

npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/blocks/email-capture-pill.json

Looks exactly like mercury.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Props: placeholder, submitLabel, secondaryLabel, onSubmit(email). Renders standalone on a light surface; the input pill and secondary pill both use 20px backdrop blur.

components/email-capture-pill.tsx
import { useState } from "react";

export default function GlassEmailCapturePill({
  placeholder = "Enter your email",
  submitLabel = "Get updates",
  secondaryLabel = "View demo",
  onSubmit,
}: {
  placeholder?: string;
  submitLabel?: string;
  secondaryLabel?: string;
  onSubmit?: (email: string) => void;
}) {
  const [email, setEmail] = useState("");
  return (
    <div className="bg-surface-light px-6 py-10">
      <form
        className="flex flex-wrap items-center gap-2"
        onSubmit={(e) => {
          e.preventDefault();
          onSubmit?.(email);
        }}
      >
        <div className="flex w-full max-w-[411px] items-center rounded-pill border border-ink-dark/10 bg-glass-fill p-1 pl-5 backdrop-blur-[20px] transition-colors duration-150 focus-within:border-accent focus-within:bg-white/70 focus-within:ring-2 focus-within:ring-accent/40">
          <label htmlFor="glass-email" className="sr-only">Email address</label>
          <input
            id="glass-email"
            type="email"
            required
            value={email}
            onChange={(e) => setEmail(e.target.value)}
            placeholder={placeholder}
            className="min-w-0 flex-1 bg-transparent font-sans text-ink-dark outline-none placeholder:text-ink-dark-muted"
          />
          <button
            type="submit"
            className="rounded-pill bg-accent px-5 py-2.5 font-sans text-white transition-colors duration-150 hover:bg-[#4a52d6] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink-dark"
          >
            {submitLabel}
          </button>
        </div>
        <button
          type="button"
          className="h-10 rounded-pill border border-ink-dark/10 bg-glass-fill px-5 font-sans text-ink-dark backdrop-blur-[20px] transition-colors duration-150 hover:bg-white/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"
        >
          {secondaryLabel}
        </button>
      </form>
    </div>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Twilight Ledger

The whole style →

Light Release Notes Header

Changelog

Cinematic Landscape Hero

Heroes

Frosted Transparent Header

Headers & nav bars

Accordion Feature List with Product Mock

Feature sections

Dark Glass Account Panel Mockup

Media & mockups

Faded Logo Marquee

Marquees & tickers