Text Effect
uifoundry/text-effectFreeComponent
Text Effect UI Component, animates in the react components passed as children. This is for text animation
Live preview
live · rendered by the registry
Rendered by uifoundry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uifoundry.dev/r/text-effect.jsonSource
1"use client";23import { cn } from "@/registry/default/utils";4import {5 AnimatePresence,6 motion,7 type TargetAndTransition,8 type Transition,9 type Variant,10 type Variants,11} from "motion/react";12import React from "react";1314export type PresetType = "blur" | "fade-in-blur" | "scale" | "fade" | "slide";1516export type PerType = "word" | "char" | "line";1718export type TextEffectProps = {19 children: string;20 per?: PerType;21 as?: keyof React.JSX.IntrinsicElements;22 variants?: {23 container?: Variants;24 item?: Variants;25 };26 className?: string;27 preset?: PresetType;28 delay?: number;29 speedReveal?: number;30 speedSegment?: number;31 trigger?: boolean;32 onAnimationComplete?: () => void;33 onAnimationStart?: () => void;34 segmentWrapperClassName?: string;35 containerTransition?: Transition;36 segmentTransition?: Transition;37 style?: React.CSSProperties;38};3940const defaultStaggerTimes: Record<PerType, number> = {41 char: 0.03,42 word: 0.05,43 line: 0.1,44};4546const defaultContainerVariants: Variants = {47 hidden: { opacity: 0 },48 visible: {49 opacity: 1,50 transition: {51 staggerChildren: 0.05,52 },53 },54 exit: {55 transition: { staggerChildren: 0.05, staggerDirection: -1 },56 },57};5859const defaultItemVariants: Variants = {60 hidden: { opacity: 0 },61 visible: {62 opacity: 1,63 },64 exit: { opacity: 0 },65};6667const presetVariants: Record<68 PresetType,69 { container: Variants; item: Variants }70> = {71 blur: {72 container: defaultContainerVariants,73 item: {74 hidden: { opacity: 0, filter: "blur(12px)" },75 visible: { opacity: 1, filter: "blur(0px)" },76 exit: { opacity: 0, filter: "blur(12px)" },77 },78 },79 "fade-in-blur": {80 container: defaultContainerVariants,81 item: {82 hidden: { opacity: 0, y: 20, filter: "blur(12px)" },83 visible: { opacity: 1, y: 0, filter: "blur(0px)" },84 exit: { opacity: 0, y: 20, filter: "blur(12px)" },85 },86 },87 scale: {88 container: defaultContainerVariants,89 item: {90 hidden: { opacity: 0, scale: 0 },91 visible: { opacity: 1, scale: 1 },92 exit: { opacity: 0, scale: 0 },93 },94 },95 fade: {96 container: defaultContainerVariants,97 item: {98 hidden: { opacity: 0 },99 visible: { opacity: 1 },100 exit: { opacity: 0 },101 },102 },103 slide: {104 container: defaultContainerVariants,105 item: {106 hidden: { opacity: 0, y: 20 },107 visible: { opacity: 1, y: 0 },108 exit: { opacity: 0, y: 20 },109 },110 },111};112113const AnimationComponent: React.FC<{114 segment: string;115 variants: Variants;116 per: "line" | "word" | "char";117 segmentWrapperClassName?: string;118// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from uifoundry
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Groupanimated-group | uifoundry | Components | Free | 2 deps | |
| Buttonbutton | uifoundry | Components | Free | 3 deps | |
| Call To Action Pair Fieldcall-to-action-pair-field | uifoundry | Components | Free | 3 deps | |
| Cardcard | uifoundry | Components | Free | 1 dep | |
| Description Fielddescription-field | uifoundry | Components | Free | 2 deps | |
| Flickering Gridflickering-grid | uifoundry | Components | Free | 1 dep | |
| Header Fieldheader-field | uifoundry | Components | Free | 2 deps | |
| Icon Componenticon | uifoundry | Components | Free | 2 deps |
