BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/magicui/line-shadow-text

Line Shadow Text

magicui/line-shadow-text
FreeComponent

A text component with a moving line shadow.

Live preview

live · rendered by the registry
Rendered by magicui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://magicui.design/r/line-shadow-text.json

Source

registry/magicui/line-shadow-text.tsxmagicui.design/r/line-shadow-text.json
1"use client"
2
3import { type CSSProperties, type HTMLAttributes } from "react"
4import {
5 motion,
6 type DOMMotionComponents,
7 type MotionProps,
8} from "motion/react"
9
10import { cn } from "@/lib/utils"
11
12const motionElements = {
13 article: motion.article,
14 div: motion.div,
15 h1: motion.h1,
16 h2: motion.h2,
17 h3: motion.h3,
18 h4: motion.h4,
19 h5: motion.h5,
20 h6: motion.h6,
21 li: motion.li,
22 p: motion.p,
23 section: motion.section,
24 span: motion.span,
25} as const
26
27type MotionElementType = Extract<
28 keyof DOMMotionComponents,
29 keyof typeof motionElements
30>
31
32interface LineShadowTextProps
33 extends Omit<HTMLAttributes<HTMLElement>, keyof MotionProps>, MotionProps {
34 children: string
35 shadowColor?: string
36 as?: MotionElementType
37}
38
39export function LineShadowText({
40 children,
41 shadowColor = "black",
42 className,
43 as: Component = "span",
44 ...props
45}: LineShadowTextProps) {
46 const MotionComponent = motionElements[Component]
47
48 return (
49 <MotionComponent
50 style={{ "--shadow-color": shadowColor } as CSSProperties}
51 className={cn(
52 "relative z-0 inline-flex",
53 "after:absolute after:top-[0.04em] after:left-[0.04em] after:content-[attr(data-text)]",
54 "after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]",
55 "after:-z-10 after:bg-size-[0.06em_0.06em] after:bg-clip-text after:text-transparent",
56 "after:animate-line-shadow",
57 className
58 )}
59 data-text={children}
60 {...props}
61 >
62 {children}
63 </MotionComponent>
64 )
65}

What it pulls in

npm packages

  • motion

Files it writes

  • registry/magicui/line-shadow-text.tsx

Facts

Registry
magicui
Type
registry:ui
Access
Free
Files written
1
Theme wiring
ships cssVars
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on magicui magicui.design magicuidesign/magicui on GitHub Raw registry item This item as JSON

More from magicui

All 247 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AndroidandroidmagicuiComponentsFreeno deps
Animated Beamanimated-beammagicuiComponentsFree1 dep
Animated Circular Progress Baranimated-circular-progress-barmagicuiComponentsFreeno deps
Animated Gradient Textanimated-gradient-textmagicuiComponentsFreeno deps
Animated Grid Patternanimated-grid-patternmagicuiComponentsFree1 dep
Animated Listanimated-listmagicuiComponentsFree1 dep
Animated Shiny Textanimated-shiny-textmagicuiComponentsFreeno deps
Theme Toggleranimated-theme-togglermagicuiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex