BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/fancy/underline-goes-out-comes-in

Underline Goes Out Comes In

fancy/underline-goes-out-comes-in
FreeComponent

A ui component.

Install it

npx shadcn@latest add https://www.fancycomponents.dev/r/underline-goes-out-comes-in.json

Source

fancy/text/underline-goes-out-comes-in.tsxwww.fancycomponents.dev/r/underline-goes-out-comes-in.json
1"use client"
2
3import { ElementType, useEffect, useRef, useState, useMemo } from "react"
4import cn from "clsx"
5import {
6 motion,
7 useAnimationControls,
8 ValueAnimationTransition,
9} from "motion/react"
10
11interface GoesOutComesInUnderlineProps {
12 /**
13 * The content to be displayed and animated
14 */
15 children: React.ReactNode
16
17 /**
18 * HTML Tag to render the component as
19 * @default span
20 */
21 as?: ElementType
22
23 /**
24 * Direction of the animation
25 * @default "left"
26 */
27 direction?: "left" | "right"
28
29 /**
30 * Optional class name for styling
31 */
32 className?: string
33
34 /**
35 * Height of the underline as a ratio of font size
36 * @default 0.1
37 */
38 underlineHeightRatio?: number
39
40 /**
41 * Padding of the underline as a ratio of font size
42 * @default 0.01
43 */
44 underlinePaddingRatio?: number
45
46 /**
47 * Animation transition configuration
48 * @default { duration: 0.5, ease: "easeOut" }
49 */
50 transition?: ValueAnimationTransition
51}
52
53const GoesOutComesInUnderline = ({
54 children,
55 as,
56 direction = "left",
57 className,
58 underlineHeightRatio = 0.1,
59 underlinePaddingRatio = 0.01,
60 transition = {
61 duration: 0.5,
62 ease: "easeOut",
63 },
64 ...props
65}: GoesOutComesInUnderlineProps) => {
66 const controls = useAnimationControls()
67 const [blocked, setBlocked] = useState(false)
68 const textRef = useRef<HTMLSpanElement>(null)
69 const MotionComponent = useMemo(() => motion.create(as ?? "span"), [as])
70
71 useEffect(() => {
72 const updateUnderlineStyles = () => {
73 if (textRef.current) {
74 const fontSize = parseFloat(getComputedStyle(textRef.current).fontSize)
75 const underlineHeight = fontSize * underlineHeightRatio
76 const underlinePadding = fontSize * underlinePaddingRatio
77 textRef.current.style.setProperty(
78 "--underline-height",
79 `${underlineHeight}px`
80 )
81 textRef.current.style.setProperty(
82 "--underline-padding",
83 `${underlinePadding}px`
84 )
85 }
86 }
87
88 updateUnderlineStyles()
89 window.addEventListener("resize", updateUnderlineStyles)
90
91 return () => window.removeEventListener("resize", updateUnderlineStyles)
92 }, [underlineHeightRatio, underlinePaddingRatio])
93
94 const animate = async () => {
95 if (blocked) return
96
97 setBlocked(true)
98
99 await controls.start({
100 width: 0,
101 transition,
102 transitionEnd: {
103 left: direction === "left" ? "auto" : 0,
104 right: direction === "left" ? 0 : "auto",
105 },
106 })
107
108// … truncated

What it pulls in

npm packages

  • clsx
  • motion

Files it writes

  • fancy/text/underline-goes-out-comes-in

Facts

Registry
fancy
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

www.fancycomponents.dev danielpetho/fancy on GitHub Raw registry item This item as JSON

More from fancy

All 158 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Gradient With Svganimated-gradient-with-svgfancyComponentsFreeno deps
Basic Number Tickerbasic-number-tickerfancyComponentsFree1 dep
Box Carouselbox-carouselfancyComponentsFree1 dep
Breathing Textbreathing-textfancyComponentsFree1 dep
Circling Elementscircling-elementsfancyComponentsFree1 dep
Css Boxcss-boxfancyComponentsFree1 dep
Cursor Attractor And Gravitycursor-attractor-and-gravityfancyComponentsFree5 deps
Drag Elementsdrag-elementsfancyComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex