Overlays & feedback / Dialogs & modals
Offer Popup Dialog
Cream rounded (32px) modal split in two: a deep green image tile with huge lime '30% OFF' lettering and a product jar, and a right column with title, subtitle, filled email input, dark pill submit and tiny legal footnotes. Dimmed scrim behind and a close X at top right.
Rebuilt from seed.com in the Verdant Lab Editorial style.
Looks exactly like seed.com: brings its fonts and colours, namespaced so your own theme stays untouched.
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: title, subtitle, badge (e.g. "25% OFF"), badgeSub, cta, backgroundSrc, legal1, legal2. The X or submitting closes the dialog; all props are optional.
components/newsletter-offer-modal.tsx
import { useState } from "react"; export default function OfferPopupDialog({ title = "The Cyber Week Offer", subtitle = "Don't miss 25% off everything.", badge = "25% OFF", badgeSub = "STOREWIDE", cta = "Claim Offer", backgroundSrc = "https://yoink-app.fly.dev/stock/nature-2.jpg", legal1 = "Offer valid with the purchase of any new or returning plan. Cannot be combined with other discounts. Discount applied automatically at checkout. Void where prohibited. Offer may be modified or terminated at any time.", legal2 = "By submitting my email, I consent to receive marketing emails from Northwind.", }: { title?: string; subtitle?: string; badge?: string; badgeSub?: string; cta?: string; backgroundSrc?: string; legal1?: string; legal2?: string; }) { const [open, setOpen] = useState(true); const [email, setEmail] = useState(""); return ( <section className="relative min-h-[720px] w-full overflow-hidden bg-ink font-sans text-canvas"> <img src={backgroundSrc} alt="" width={1600} height={1200} className="absolute inset-0 h-full w-full object-cover" /> <div className="absolute inset-0 bg-top-scrim" /> <div className="absolute inset-0 bg-hero-side-scrim" /> <header className="relative flex items-center gap-8 px-6 py-6 text-label"> <span className="flex items-center gap-1 text-h3">Northwind<span className="h-3 w-3 rounded-full bg-canvas" /></span> <span>Shop</span><span>Science</span><span>Learn</span> <span className="ml-auto">Sign in</span> </header> <div className="relative px-6 pt-24 md:px-14"> <h1 className="max-w-md text-h1 opacity-70">Build a routine with 25% off and a free gift.</h1> <button className="mt-8 rounded-pill bg-canvas/30 px-6 py-3 text-ink backdrop-blur">Shop now</button> </div> {open && ( <div className="absolute inset-0 z-10 flex animate-[fadeIn_400ms_ease-out] items-center justify-center bg-scrim p-4" role="dialog" aria-modal="true" aria-label={title}> <style>{`@keyframes fadeIn{from{opacity:0}to{opacity:1}}`}</style> <div className="relative grid w-full max-w-[717px] gap-4 rounded-[32px] bg-canvas p-[15px] text-ink shadow-popup md:grid-cols-[336px_1fr]"> <div className="relative flex min-h-[420px] flex-col overflow-hidden rounded-[20px] bg-[#12301c] p-4 md:h-[470px]"> <div className="absolute inset-0 bg-[radial-gradient(70%_50%_at_50%_75%,#2f6a3f,transparent)]" /> <div className="relative flex flex-col text-[56px] font-medium leading-[0.9] tracking-[-0.04em] text-lime-highlight"> <span className="flex items-center gap-1"><span className="h-[50px] w-[50px] rounded-full bg-lime-highlight" />{badge.replace("%", "%").split(" ")[0]}</span> <span>{badge.split(" ")[1]}</span> <span className="text-[46px]">{badgeSub}</span> </div> <div className="relative mx-auto mt-auto flex h-48 w-40 flex-col items-center rounded-[18px] border border-white/10 bg-gradient-to-b from-[#2a3a2d] to-[#0f1a12] pt-3 shadow-capsule-drop"> <div className="-mt-6 h-6 w-36 rounded-t-lg bg-[#1b261d]" /> <span className="mt-8 text-caption text-canvas">Northwind</span> <span className="mt-auto mb-6 text-[8px] tracking-wide text-canvas/80">DAILY CAPSULE</span> </div> </div> <div className="flex flex-col justify-center px-2 pb-4 pt-10 md:pr-4"> <button onClick={() => setOpen(false)} aria-label="Close" className="absolute right-5 top-5 rounded-full p-1 focus-visible:outline focus-visible:outline-2"> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M2 2l12 12M14 2L2 14" /></svg> </button> <h2 className="text-h2">{title}</h2> <p className="mt-2 text-lead">{subtitle}</p> <form onSubmit={(e) => { e.preventDefault(); setOpen(false); }} className="mt-8 flex flex-col gap-4"> <input type="email" required value={email} onChange={(e) => setEmail(e.target.value)} placeholder="Email Address" aria-label="Email Address" className="rounded-input bg-surface-foam px-3 py-3.5 text-body placeholder:text-ink-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink" /> <button type="submit" className="h-14 w-[312px] max-w-full rounded-pill bg-ink text-body text-canvas transition-all duration-ui-hover ease-ui-hover hover:bg-forest-soft focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">{cta}</button> </form> <p className="mt-6 text-[10px] leading-[11px]">{legal1}</p> <p className="mt-3 text-[10px] leading-[11px]">{legal2}</p> </div> </div> </div> )} </section> ); }import { useState } from "react"; export default function OfferPopupDialog({ title = "The Cyber Week Offer", subtitle = "Don't miss 25% off everything.", badge = "25% OFF", badgeSub = "STOREWIDE", cta = "Claim Offer", backgroundSrc = "https://yoink-app.fly.dev/stock/nature-2.jpg", legal1 = "Offer valid with the purchase of any new or returning plan. Cannot be combined with other discounts. Discount applied automatically at checkout. Void where prohibited. Offer may be modified or terminated at any time.", legal2 = "By submitting my email, I consent to receive marketing emails from Northwind.", }: { title?: string; subtitle?: string; badge?: string; badgeSub?: string; cta?: string; backgroundSrc?: string; legal1?: string; legal2?: string; }) { const [open, setOpen] = useState(true); const [email, setEmail] = useState(""); return ( <section className="relative min-h-[720px] w-full overflow-hidden bg-foreground font-sans text-background"> <img src={backgroundSrc} alt="" width={1600} height={1200} className="absolute inset-0 h-full w-full object-cover" /> <div className="absolute inset-0 " /> <div className="absolute inset-0 " /> <header className="relative flex items-center gap-8 px-6 py-6 text-verdant-label"> <span className="flex items-center gap-1 text-verdant-h3">Northwind<span className="h-3 w-3 rounded-full bg-background" /></span> <span>Shop</span><span>Science</span><span>Learn</span> <span className="ml-auto">Sign in</span> </header> <div className="relative px-6 pt-24 md:px-14"> <h1 className="max-w-md text-verdant-h1 opacity-70">Build a routine with 25% off and a free gift.</h1> <button className="mt-8 rounded-full bg-background/30 px-6 py-3 text-foreground backdrop-blur">Shop now</button> </div> {open && ( <div className="absolute inset-0 z-10 flex animate-[fadeIn_400ms_ease-out] items-center justify-center bg-foreground p-4" role="dialog" aria-modal="true" aria-label={title}> <style>{`@keyframes fadeIn{from{opacity:0}to{opacity:1}}`}</style> <div className="relative grid w-full max-w-[717px] gap-4 rounded-[32px] bg-background p-[15px] text-foreground shadow-verdant-popup md:grid-cols-[336px_1fr]"> <div className="relative flex min-h-[420px] flex-col overflow-hidden rounded-[20px] bg-[#12301c] p-4 md:h-[470px]"> <div className="absolute inset-0 bg-[radial-gradient(70%_50%_at_50%_75%,#2f6a3f,transparent)]" /> <div className="relative flex flex-col text-[56px] font-medium leading-[0.9] tracking-[-0.04em] text-verdant-lime-highlight"> <span className="flex items-center gap-1"><span className="h-[50px] w-[50px] rounded-full bg-verdant-lime-highlight" />{badge.replace("%", "%").split(" ")[0]}</span> <span>{badge.split(" ")[1]}</span> <span className="text-[46px]">{badgeSub}</span> </div> <div className="relative mx-auto mt-auto flex h-48 w-40 flex-col items-center rounded-[18px] border border-background/10 bg-gradient-to-b from-[#2a3a2d] to-[#0f1a12] pt-3 shadow-verdant-capsule-drop"> <div className="-mt-6 h-6 w-36 rounded-t-lg bg-[#1b261d]" /> <span className="mt-8 text-verdant-caption text-background">Northwind</span> <span className="mt-auto mb-6 text-[8px] tracking-wide text-background/80">DAILY CAPSULE</span> </div> </div> <div className="flex flex-col justify-center px-2 pb-4 pt-10 md:pr-4"> <button onClick={() => setOpen(false)} aria-label="Close" className="absolute right-5 top-5 rounded-full p-1 focus-visible:outline focus-visible:outline-2"> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M2 2l12 12M14 2L2 14" /></svg> </button> <h2 className="text-verdant-h2">{title}</h2> <p className="mt-2 text-verdant-lead">{subtitle}</p> <form onSubmit={(e) => { e.preventDefault(); setOpen(false); }} className="mt-8 flex flex-col gap-4"> <input type="email" required value={email} onChange={(e) => setEmail(e.target.value)} placeholder="Email Address" aria-label="Email Address" className="rounded-md bg-muted px-3 py-3.5 text-verdant-body placeholder:text-muted-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-foreground" /> <button type="submit" className="h-14 w-[312px] max-w-full rounded-full bg-foreground text-verdant-body text-background transition-all duration-verdant-ui-hover ease-verdant-ui-hover hover:bg-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">{cta}</button> </form> <p className="mt-6 text-[10px] leading-[11px]">{legal1}</p> <p className="mt-3 text-[10px] leading-[11px]">{legal2}</p> </div> </div> </div> )} </section> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: not passed4 hard-coded colours (bg-[#12301c], from-[#2a3a2d], to-[#0f1a12], bg-[#1b261d]). These ignore the theme and break dark mode.
- Animates cleanly: passedIts animation plays and finishes with everything visible, and it stays still for people who turn on reduced motion.