Shiny Text
A zero-JS CSS gradient mask that sweeps a high-contrast specular gleam across headings, status pills, or feature callouts at configurable speed and angle.
#gradient#sheen#badge#css
Luminous Glass Specular
Customize
3.2s
#FFFFFF
#8E84A2
Installation
$pnpm dlx yourbrand@latest add @yourbrand/ShinyText-TS-TWUsage (synced with live props)
<ShinyText
text="Luminous Glass Specular"
speed={3.2}
shineColor="#FFFFFF"
baseColor="#8E84A2"
/>Source Code
ShinyText.tsx"use client";
import React from "react";
export interface ShinyTextProps {
text?: string;
speed?: number;
shineColor?: string;
baseColor?: string;
}
export function ShinyText({
text = "Luminous Glass Specular",
speed = 3.2,
shineColor = "#FFFFFF",
baseColor = "#8E84A2",
}: ShinyTextProps) {
return (
<span
className="inline-block bg-clip-text text-3xl font-medium tracking-tight text-transparent"
style={{
backgroundImage: `linear-gradient(120deg, ${baseColor} 35%, ${shineColor} 50%, ${baseColor} 65%)`,
backgroundSize: "220% 100%",
animation: `shinySweep ${speed}s linear infinite`,
}}
>
{text}
</span>
);
}
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | "Luminous Glass Specular" | Text to illuminate. |
| speed | number | 3.2 | Seconds per shine pass. |
| shineColor | string (hex) | "#FFFFFF" | Specular beam color. |
| baseColor | string (hex) | "#8E84A2" | Unlit resting text color. |