Vilqor

Shimmer Text Heading

Heroes

About

Text in one colour that catches the light: every few seconds a soft glint runs across it. Plain coloured text at rest and with reduced motion; italic overhang is not clipped. 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 Shimmer Text Heading to your project and fits it to your theme.

Code

How Shimmer Text Heading is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useSyncExternalStore } from "react"

import { GlintText } from "@/components/ui/glint-text"

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');"

// Midnight by day: warm paper, night-blue ink, the glint over deep gold
const settings = {
  lead: "Your work,",
  accent: "done by morning.",
  duration: 4,
  background: "#f7f5f0",
  text: "#141a2e",
  color: "#a8803a",
}

// Midnight by night, the template's own palette
const night: Partial<typeof settings> = {
  background: "#0b1020",
  text: "#ece9e1",
  color: "#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,
  )
}

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 items-center justify-center px-6" style={{ background: s.background }}>
      <style>{fraunces}</style>
      <h1
        className="text-center text-[clamp(48px,9vw,112px)] leading-[0.98] tracking-[-0.03em] text-balance"
        style={{ color: s.text, fontFamily: "Fraunces, ui-serif, Georgia, serif", fontWeight: 340, fontVariationSettings: '"SOFT" 60, "opsz" 144' }}
      >
        {s.lead}
        <br />
        <GlintText as="em" color={s.color} duration={s.duration} delay={0.4}>
          {s.accent}
        </GlintText>
      </h1>
    </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 Heroes

View all
  • Agency Hero Section

    Agency Hero Section

    1.1K
  • Real Estate 3D Hero

    Real Estate 3D Hero

    86
  • Responsive Hero Banner

    Responsive Hero Banner

    2.2K
  • SaaS Template

    SaaS Template

    2.8K
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    35
  • Hero

    Hero

    1.4K
  • App Integration Celestial Hero

    App Integration Celestial Hero

    17
  • Chroma Sense Hero

    Chroma Sense Hero

    22