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>
)
}
















