BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/eldoraui/font-weight-text

font-weight-text

eldoraui/font-weight-text
FreeComponent

A font weight text component.

Live preview

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

Install it

npx shadcn@latest add https://eldoraui.site/r/font-weight-text.json

Source

registry/eldoraui/font-weight-text.tsxeldoraui.site/r/font-weight-text.json
1"use client"
2
3import { useEffect, useRef } from "react"
4
5import { cn } from "@/lib/utils"
6
7interface FontWeightTextProps {
8 text: string
9 className?: string
10 fontSize?: number
11 minWeight?: number
12 maxWeight?: number
13 animationDuration?: number
14 delayMultiplier?: number
15}
16
17export function FontWeightText({
18 text,
19 className = "",
20 fontSize = 150,
21 minWeight = 0,
22 maxWeight = 840,
23 animationDuration = 1.5,
24 delayMultiplier = 0.25,
25}: FontWeightTextProps) {
26 const containerRef = useRef<HTMLParagraphElement>(null)
27
28 useEffect(() => {
29 if (!containerRef.current) return
30
31 const spans = containerRef.current.querySelectorAll("span")
32 const numLetters = spans.length
33
34 spans.forEach((span, i) => {
35 const mappedIndex = i - numLetters / 2
36 span.style.animationDelay = mappedIndex * delayMultiplier + "s"
37 })
38 }, [text, delayMultiplier])
39
40 const characters = text.split("").map((char, index) => (
41 <span
42 key={index}
43 aria-hidden="true"
44 style={{
45 animation: `breath ${animationDuration}s alternate cubic-bezier(0.37, 0, 0.63, 1) infinite`,
46 animationFillMode: "both",
47 fontVariationSettings: `"wght" ${minWeight}`,
48 }}
49 >
50 {char}
51 </span>
52 ))
53
54 return (
55 <div className="flex items-center justify-center">
56 <p
57 className={cn("m-0 font-sans", className)}
58 ref={containerRef}
59 aria-label={text}
60 style={{
61 fontSize: `${fontSize}px`,
62 fontFeatureSettings: '"wght"',
63 }}
64 >
65 {characters}
66 <style jsx>{`
67 @keyframes breath {
68 0% {
69 font-variation-settings: "wght" ${minWeight};
70 }
71 100% {
72 font-variation-settings: "wght" ${maxWeight};
73 }
74 }
75 `}</style>
76 </p>
77 </div>
78 )
79}

What it pulls in

npm packages

  • react

Other registry items

  • utils

Files it writes

  • registry/eldoraui/font-weight-text.tsx

Facts

Registry
eldoraui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on eldoraui eldoraui.site karthikmudunuri/eldoraui on GitHub Raw registry item This item as JSON

More from eldoraui

All 115 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
animated-badgeanimated-badgeeldorauiComponentsFree2 deps
animated-frameworksanimated-frameworkseldorauiComponentsFree2 deps
animated-grid-patternanimated-grid-patterneldorauiComponentsFree3 deps
animated-listanimated-listeldorauiComponentsFree1 dep
animated-shiny-buttonanimated-shiny-buttoneldorauiComponentsFree1 dep
blur-in-textblur-in-texteldorauiComponentsFree3 deps
browserbrowsereldorauiComponentsFree2 deps
card-flip-hovercard-flip-hovereldorauiComponentsFree1 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