Vilqor

CTA Section with Glow

CTAs

About

A closing call to action: a large serif title with an accent word that catches the light, one button with a sheen, stars and a soft light in the middle. Part of Midnight, the full template on 21st; also in the free Midnight Lite (MIT).

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds CTA Section with Glow to your project and fits it to your theme.

Code

How CTA Section with Glow is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useSyncExternalStore, type CSSProperties } from "react"

import { NightCta } from "@/components/ui/night-cta"

const fraunces =
  "@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..600,0..100;1,9..144,300..600,0..100&display=swap');"

const settings = {
  lead: "Hand it off",
  accent: "tonight.",
  button: "Start free",
  paper: "#f7f5f0",
  ink: "#141a2e",
  muted: "#4a5166",
  primary: "#a8803a",
}

// Midnight by night, the template's own palette
const night: Partial<typeof settings> = {
  paper: "#0b1020",
  ink: "#ece9e1",
  muted: "#a9afc4",
  primary: "#d9b77e",
}

// 21st marks its dark theme with .dark on <html>; the demo answers with Midnight by night
function useDark() {
  return useSyncExternalStore(
    (on) => {
      const watch = new MutationObserver(on)
      watch.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] })
      return () => watch.disconnect()
    },
    () => document.documentElement.classList.contains("dark"),
    () => false,
  )
}

// Midnight by day as theme tokens: warm paper, night-blue ink, deep gold with white text on it; gold stars
function day(s: typeof settings, dark: boolean) {
  const t: Record<string, string> = {
    background: s.paper,
    foreground: s.ink,
    primary: s.primary,
    "primary-foreground": dark ? s.paper : "#ffffff",
    "muted-foreground": s.muted,
    ring: s.primary,
  }
  const tokens = Object.fromEntries(Object.entries(t).flatMap(([k, v]) => [[`--${k}`, v], [`--color-${k}`, v]]))
  // at night the stars, rosette and sparks keep their own colours
  if (dark) return tokens as CSSProperties
  return {
    ...tokens,
    "--mn-star": "#a5813f",
    "--mn-star-k": "1.6",
  } as CSSProperties
}

export default function Demo(props: Partial<typeof settings>) {
  const dark = useDark()
  const s = { ...settings, ...props, ...(dark ? night : {}) }
  return (
    <div className="flex min-h-svh w-full flex-col justify-center" style={{ ...day(s, dark), "--font-display": "Fraunces, ui-serif, Georgia, serif", background: s.paper } as CSSProperties}>
      <style>{fraunces}</style>
      <NightCta
        title={{ lead: s.lead, accent: s.accent }}
        lead="Start free. Your first brief arrives tomorrow at 7:00."
        button={{ label: s.button, href: "#" }}
        note="Free plan · No card required"
      />
    </div>
  )
}

Dependencies

More by Vilqor

View all
  • 3D Glass Cube Hero

    3D Glass Cube Hero

    210
  • Footer with Big Wordmark

    Footer with Big Wordmark

    163
  • Guilloche Background Pattern

    Guilloche Background Pattern

    8
  • Card Carousel to Grid

    Card Carousel to Grid

  • AI Email Reply with Tones

    AI Email Reply with Tones

  • AI Memory Timeline

    AI Memory Timeline

  • Use Cases Tabs Section

    Use Cases Tabs Section

  • Pricing Section with Toggle

    Pricing Section with Toggle

More in CTAs

View all
  • Hills Landscape Footer with Call to Action

    Hills Landscape Footer with Call to Action

    393
  • Call to action

    Call to action

    186
  • Cta 4

    Cta 4

    314
  • Responsive Hero Banner

    Responsive Hero Banner

    2.2K
  • Button

    Button

    168
  • Hero

    Hero

    1.4K
  • Call to Action

    Call to Action

    6
  • CTA 3

    CTA 3

    422