Cards & content / Media & mockups

Email Composer Window

Wide dark app window with toolbar (Styles button, centered title, timestamp, outline Test and white Send buttons) holding a From/To/Subject header with divider lines, a dark rendered banner image and a white paper writing area with 'Press / for commands' placeholder. A violet glow lines the top edge and the bottom fades out.

Rebuilt from resend.com in the Obsidian Serif Glow style.

npx shadcn@latest add https://justyoink.it/r/obsidian-serif-glow/blocks/email-composer-mockup.json

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

Usage

Props: title, description, docTitle, from, recipients, subject, placeholder, saved. Renders standalone with defaults; the window's bottom edge fades to black via a mask.

components/email-composer-mockup.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
export default function EmailComposerWindow({
  title = "Write with a calm, focused editor",
  description = "A friendly editor that helps your team draft, format and ship messages. Build each message visually and restyle it with your own themes.",
  docTitle = "Monthly Northwind Digest",
  from = "hello@northwind.dev",
  recipients = "Product Readers",
  subject = "Monthly Digest",
  placeholder = "Press '/' for commands",
  saved = "2 hours ago",
}: {
  title?: string;
  description?: string;
  docTitle?: string;
  from?: string;
  recipients?: string;
  subject?: string;
  placeholder?: string;
  saved?: string;
}) {
  return (
    <section className="relative overflow-hidden bg-background px-4 py-20 text-primary">
      <div className="mx-auto flex max-w-3xl flex-col items-center text-center">
        <div className="relative h-[150px] w-[150px] rounded-[36px] border border-hairline-soft bg-gradient-to-b from-surface-high to-background shadow-card-soft">
          <div className="absolute left-1/2 top-1/2 h-[96px] w-[96px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-[radial-gradient(circle_at_40%_30%,#e5e5e5,#3a3a3a_45%,#0a0a0a_80%)]" />
          <div className="absolute inset-x-6 bottom-1 h-3 rounded-full bg-[#7c3aed] opacity-80 blur-md" />
        </div>
        <h2 className="mt-8 bg-silver-text bg-clip-text text-4xl font-medium tracking-[-0.03em] text-transparent md:text-6xl">{title}</h2>
        <p className="mt-5 max-w-xl text-lead text-secondary">{description}</p>
      </div>

      <Reveal from="up" className="relative mx-auto mt-16 max-w-5xl">
        <div className="relative overflow-hidden rounded-t-xl border border-hairline bg-surface [mask-image:linear-gradient(#000_40%,transparent_100%)]">
          <div className="pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#8b5cf6] to-transparent" />
          <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(41%_8%_at_50%_0%,rgba(255,255,255,0.1),transparent)]" />
          <div className="relative flex items-center justify-between gap-3 border-b border-hairline px-4 py-4 md:px-6">
            <button className="flex items-center gap-2 rounded-md border border-hairline bg-surface-raised px-3 py-1.5 text-ui text-secondary transition-colors duration-hover-color hover:text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue">
              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true"><path d="M4 14l8-8 8 8-6 6z" /></svg>
              Styles
            </button>
            <span className="hidden truncate text-ui text-secondary sm:block">{docTitle}</span>
            <div className="flex items-center gap-3">
              <span className="hidden items-center gap-2 text-ui text-secondary md:flex">
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true"><circle cx="12" cy="12" r="9" /><path d="M12 7v5l3 2" /></svg>
                {saved}
              </span>
              <button className="rounded-md border border-hairline bg-background px-3 py-1.5 text-ui text-primary transition-colors duration-hover-color hover:bg-surface-high focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue">Test</button>
              <button className="rounded-md bg-paper px-3 py-1.5 text-ui text-background transition-opacity hover:opacity-80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue">Send</button>
            </div>
          </div>

          <div className="relative px-4 py-10 md:px-0">
            <div className="mx-auto max-w-[662px] overflow-hidden rounded-t-xl border border-hairline bg-background">
              <div className="px-8">
                {[["From", from], ["To", ""], ["Subject", subject]].map(([k, v], i) => (
                  <div key={k} className={`flex items-center gap-8 py-3.5 text-ui ${i < 2 ? "border-b border-hairline" : ""}`}>
                    <span className="w-14 text-secondary">{k}</span>
                    {k === "To" ? (
                      <span className="flex items-center gap-2 rounded-pill bg-surface-high px-3 py-1 text-primary">
                        <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="8" cy="8" r="3" /><circle cx="16" cy="8" r="3" /><path d="M2 20c0-4 3-6 6-6s6 2 6 6zM14 20c0-2 1-4 3-5 3 0 5 2 5 5z" /></svg>
                        {recipients}
                      </span>
                    ) : (
                      <span className="text-primary">{v}</span>
                    )}
                  </div>
                ))}
              </div>
              <div className="relative h-[215px] overflow-hidden border-t border-hairline bg-gradient-to-br from-surface-high via-background to-background">
                <div className="absolute -left-10 top-4 h-16 w-[420px] -rotate-[28deg] bg-gradient-to-r from-white/15 to-transparent" />
                <div className="absolute -left-10 top-28 h-14 w-[380px] -rotate-[28deg] bg-gradient-to-r from-white/10 to-transparent" />
                <div className="absolute right-12 top-1/2 flex h-40 w-40 -translate-y-1/2 items-center justify-center rounded-full border border-hairline bg-gradient-to-b from-surface-high to-background">
                  <svg width="90" height="60" viewBox="0 0 90 60" aria-hidden="true"><defs><linearGradient id="cg" x1="0" x2="1"><stop offset="0" stopColor="#fff" /><stop offset="1" stopColor="#444" /></linearGradient></defs><path d="M0 0l34 30L0 60zM30 0l34 30-34 30zM56 0l34 30-34 30z" fill="url(#cg)" /></svg>
                </div>
              </div>
              <div className="h-[315px] bg-paper px-12 py-5 text-body text-muted">{placeholder}</div>
            </div>
          </div>
        </div>
      </Reveal>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal ----

const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";

const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;

function ykReducedMotion(): boolean {
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
}

// "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance.
// Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed,
// and there is a box to watch), and a safety net reveals anything on screen that is still hidden.
type YkRevealState = "idle" | "hidden" | "shown";

function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState {
  const [state, setState] = useState<YkRevealState>("idle");
  useYkLayoutEffect(() => {
    const el = ref.current;
    if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return;
    // watch the element's own box, or its children when it has none (display: contents)
    const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]);
    const onScreen = (t: Element) => {
      const r = t.getBoundingClientRect();
      return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth;
    };
    if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible
    let shown = false;
    const show = (v: boolean) => {
      if (v !== shown) (shown = v), setState(v ? "shown" : "hidden");
    };
    setState("hidden");
    const inView = new Set<Element>();
    const io = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) inView.add(e.target);
        else inView.delete(e.target);
      }
      if (inView.size) {
        show(true);
        if (once) io.disconnect();
      } else if (!once) show(false);
    });
    const watched = new Set<Element>();
    const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t)));
    watch();
    // safety net: styles that land after mount (display: contents) get watched too, and nothing
    // stays hidden for more than a moment while it is actually on screen
    const start = Date.now();
    const net = setInterval(() => {
      if (shown) return once && clearInterval(net);
      watch();
      if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true);
    }, 600);
    return () => {
      io.disconnect();
      clearInterval(net);
    };
  }, [once]);
  return state;
}

type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none";

/** Fades content in as it scrolls into view. */
function Reveal({
  children,
  from = "up",
  delay = 0,
  duration = 700,
  distance = 24,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  from?: YkRevealFrom;
  delay?: number;
  duration?: number;
  distance?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  const hidden = state === "hidden";
  const offset = {
    up: `translate3d(0, ${distance}px, 0)`,
    down: `translate3d(0, ${-distance}px, 0)`,
    left: `translate3d(${-distance}px, 0, 0)`,
    right: `translate3d(${distance}px, 0, 0)`,
    scale: "scale(0.94)",
    blur: `translate3d(0, ${distance / 2}px, 0)`,
    none: "none",
  }[from];
  const t = `${duration}ms ${YK_EASE} ${delay}ms`;
  return (
    <Tag
      ref={ref}
      className={className}
      style={{
        ...style,
        ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }),
        ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }),
      }}
    >
      {children}
    </Tag>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Obsidian Serif Glow

The whole style →

Blue Glass Agent Config Card

Forms

Hairline Use-Case Grid

Feature sections

Serif Hero with Dark 3D Object

Heroes

Monochrome Logo Cloud

Logo clouds

Language Picker and Code Window

Code blocks

Glossy Icon Section Header

Feature sections