BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/fancy/letter-3d-swap

Letter 3d Swap

fancy/letter-3d-swap
FreeComponent

A ui component.

Install it

npx shadcn@latest add https://www.fancycomponents.dev/r/letter-3d-swap.json

Source

fancy/text/letter-3d-swap.tsxwww.fancycomponents.dev/r/letter-3d-swap.json · first 6 KB
1"use client"
2
3import React, { ElementType, useCallback, useMemo, useState } from "react"
4import {
5 AnimationOptions,
6 useAnimate,
7 ValueAnimationTransition,
8} from "motion/react"
9
10import { cn } from "@/lib/utils"
11
12// handy function to split text into characters with support for unicode and emojis
13const splitIntoCharacters = (text: string): string[] => {
14 if (typeof Intl !== "undefined" && "Segmenter" in Intl) {
15 const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" })
16 return Array.from(segmenter.segment(text), ({ segment }) => segment)
17 }
18 // Fallback for browsers that don't support Intl.Segmenter
19 return Array.from(text)
20}
21
22// handy function to extract text from children
23const extractTextFromChildren = (children: React.ReactNode): string | undefined => {
24 // Handle null/undefined
25 if (children == null) return ""
26
27 // Handle string
28 if (typeof children === "string") return children
29
30 // Handle number
31 if (typeof children === "number") return String(children)
32
33 // Handle arrays (including fragments)
34 if (Array.isArray(children)) {
35 return children.map(extractTextFromChildren).join("")
36 }
37
38 // Handle React elements
39 if (React.isValidElement(children)) {
40 const props = (children as React.ReactElement).props
41 const childText = (props as any).children as React.ReactNode
42
43 // Recursively extract text from children
44 if (childText != null) {
45 return extractTextFromChildren(childText)
46 }
47
48 return ""
49 }
50}
51
52/**
53 * Internal helper interface for representing a word in the text with its characters and spacing information
54 */
55interface WordObject {
56 /**
57 * Array of individual characters in the word
58 */
59 characters: string[]
60 /**
61 * Whether this word needs a space after it
62 */
63 needsSpace: boolean
64}
65
66interface Letter3DSwapProps {
67 /**
68 * The content to be displayed and animated
69 */
70 children: React.ReactNode
71
72 /**
73 * HTML Tag to render the component as
74 */
75 as?: ElementType
76 /**
77 * Class name for the main container element.
78 */
79 mainClassName?: string
80
81 /**
82 * Class name for the front face element.
83 */
84 frontFaceClassName?: string
85
86 /**
87 * Class name for the secondary face element.
88 */
89 secondFaceClassName?: string
90
91 /**
92 * Duration of stagger delay between elements in seconds.
93 * @default 0.05
94 */
95 staggerDuration?: number
96
97 /**
98 * Direction to stagger animations from.
99 * @default "first"
100 */
101// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • fancy/text/letter-3d-swap

Facts

Registry
fancy
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-09
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