Curtain Text
Customize
Props
| Property | Type | Default | Description |
|---|---|---|---|
text | string | "CURTAIN" | The text to display. |
direction | "up" | "down" | "left" | "right" | "up" | Direction chars slide OUT on hover. Reveal enters from opposite. |
resetOnLeave | boolean | true | If false, the animation stays in its hovered state once triggered. |
staggerMs | number | 60 | Delay (ms) added per character for the stagger effect. |
durationMs | number | 400 | Duration (ms) of each character's slide transition. |
easing | string | "cubic-bezier(.77,0,.18,1)" | CSS easing / timing function string for the transition. |
baseColor | string | "#ffffff" | CSS color value for the resting base layer. |
activeColor | string | "#a889c7" | CSS color value for the incoming reveal layer. |
fontClass | string | "font-black" | Tailwind font-weight class applied to both layers. (TW variants only) |
fontWeight | string | "900" | CSS font-weight applied to both layers. (CSS variants only) |
fontSize | string | "clamp(1.5rem, 6vw, 5rem)" | CSS font-size value applied to both layers. |
letterSpacing | string | "0.1em" | CSS letter-spacing value. (CSS variants only) |
tracking | string | "tracking-widest" | Tailwind letter-spacing class. (TW variants only) |
textClassName | string | "" | Extra classes for the base layer. Supports Tailwind gradients/animations. (TW variants only) |
activeClassName | string | "" | Extra classes for the reveal layer. Falls back to textClassName if empty. (TW variants only) |
className | string | "" | Extra classes forwarded to the wrapper element. |
textstringThe text to display.
"CURTAIN"direction"up" | "down" | "left" | "right"Direction chars slide OUT on hover. Reveal enters from opposite.
"up"resetOnLeavebooleanIf false, the animation stays in its hovered state once triggered.
truestaggerMsnumberDelay (ms) added per character for the stagger effect.
60durationMsnumberDuration (ms) of each character's slide transition.
400easingstringCSS easing / timing function string for the transition.
"cubic-bezier(.77,0,.18,1)"baseColorstringCSS color value for the resting base layer.
"#ffffff"activeColorstringCSS color value for the incoming reveal layer.
"#a889c7"fontClassstringTailwind font-weight class applied to both layers. (TW variants only)
"font-black"fontWeightstringCSS font-weight applied to both layers. (CSS variants only)
"900"fontSizestringCSS font-size value applied to both layers.
"clamp(1.5rem, 6vw, 5rem)"letterSpacingstringCSS letter-spacing value. (CSS variants only)
"0.1em"trackingstringTailwind letter-spacing class. (TW variants only)
"tracking-widest"textClassNamestringExtra classes for the base layer. Supports Tailwind gradients/animations. (TW variants only)
""activeClassNamestringExtra classes for the reveal layer. Falls back to textClassName if empty. (TW variants only)
""classNamestringExtra classes forwarded to the wrapper element.
""Crafted withbyMohammad Tasin
