text-shimmer
agent-elements/text-shimmerFreeComponent
agent-elements publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by agent-elements on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://agent-elements.21st.dev/r/text-shimmer.jsonSource
1import React from "react";2import { cn } from "./utils/cn";34export type TextShimmerProps = {5 children: React.ReactNode;6 as?: React.ElementType;7 className?: string;8 duration?: number;9 spread?: number;10 delay?: number;11};1213function TextShimmerComponent({14 children,15 as: Component = "p",16 className,17 duration = 2,18 spread = 100,19 delay = 0,20}: TextShimmerProps) {21 const style = {22 "--an-shimmer-duration": `${duration}s`,23 "--an-shimmer-spread": `${spread}px`,24 animationDelay: delay > 0 ? `${delay}s` : undefined,25 animationDuration: `${duration}s`,26 animationIterationCount: "infinite",27 animationTimingFunction: "linear",28 } as React.CSSProperties;2930 return (31 <Component32 className={cn("an-text-shimmer", "an-text-shimmer--active", className)}33 style={style}34 >35 {children}36 </Component>37 );38}3940export const TextShimmer = React.memo(TextShimmerComponent);
More from agent-elements
All 25 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| agent-chatagent-chat | agent-elements | Components | Free | no deps | |
| attachment-buttonattachment-button | agent-elements | Components | Free | no deps | |
| bash-toolbash-tool | agent-elements | Components | Free | no deps | |
| edit-tooledit-tool | agent-elements | Components | Free | no deps | |
| error-messageerror-message | agent-elements | Components | Free | no deps | |
| file-attachmentfile-attachment | agent-elements | Components | Free | no deps | |
| generic-toolgeneric-tool | agent-elements | Components | Free | no deps | |
| input-barinput-bar | agent-elements | Components | Free | no deps |
