BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/100xui/motion-link

Motion link

100xui/motion-link
FreeBlock

Exclusive to Next.js. A reusable component that extends the <Link/> component from "next/link" to power interactive animations using motion.dev. It includes three predefined variants: <MotionLinkUnderline/>, <MotionLinkSlideText/>, and <MotionLinkWithIcon/>, while the base <MotionLink/> provides full flexibility to define custom animations with MotionProps like whileFocus, whileHover, and whileInView.

Live preview

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

Install it

npx shadcn@latest add https://100xui.com/r/motion-link.json

Source

registry/100xui/blocks/motion-link/components/motion-link.tsx100xui.com/r/motion-link.json
1"use client";
2
3import React from "react";
4import Link, { type LinkProps } from "next/link";
5import { motion, stagger, MotionConfig, type MotionProps } from "motion/react";
6
7import { cn } from "@/lib/utils";
8
9const MLink = motion.create(Link);
10
11type CombinedAnchorProps = Omit<
12 React.AnchorHTMLAttributes<HTMLAnchorElement>,
13 keyof LinkProps | "href"
14>;
15
16export type MotionLinkBaseProps = LinkProps & MotionProps & CombinedAnchorProps;
17export function MotionLink(props: MotionLinkBaseProps) {
18 return <MLink {...props} />;
19}
20
21export interface MotionLinkUnderlineProps extends MotionLinkBaseProps {
22 underlineColor?: React.CSSProperties["background"];
23 underlineHeight?: React.CSSProperties["height"];
24 startDirection?: "left" | "right";
25 endDirection?: "left" | "right";
26}
27export function MotionLinkUnderline({
28 className,
29 children,
30 underlineColor = "var(--color-foreground)",
31 underlineHeight = "2px",
32 startDirection = "left",
33 endDirection = "right",
34 ...rest
35}: MotionLinkUnderlineProps) {
36 const isStartDirectionLeft = startDirection === "left";
37 const isEndDirectionRight = endDirection === "right";
38
39 const underlineActiveStyles = {
40 width: "100%",
41 ...(isStartDirectionLeft
42 ? { left: "0px", right: "auto" }
43 : { left: "auto", right: "0px" }),
44 };
45
46 return (
47 <MotionLink
48 initial="initial"
49 whileFocus="whileFocus"
50 whileHover="whileHover"
51 className={cn(
52 "!relative w-fit !text-nowrap text-inherit focus-visible:!outline-0",
53 className,
54 )}
55 {...rest}
56 >
57 {children}
58 <motion.div
59 style={{
60 height: underlineHeight,
61 background: underlineColor,
62 }}
63 className="absolute bottom-0"
64 variants={{
65 initial: {
66 width: "0%",
67 ...(isEndDirectionRight
68 ? { left: "auto", right: "0px" }
69 : { left: "0px", right: "auto" }),
70 },
71 whileHover: underlineActiveStyles,
72 whileFocus: underlineActiveStyles,
73 }}
74 transition={{
75 left: { duration: 0 },
76 right: { duration: 0 },
77 default: { ease: "easeInOut" },
78 }}
79 />
80 </MotionLink>
81 );
82}
83
84export interface MotionLinkSlideTextProps extends MotionLinkBaseProps {
85 children: string;
86}
87
88export function MotionLinkSlideText({
89 children,
90 className,
91 ...rest
92}: MotionLinkSlideTextProps) {
93 const characters = children.split("");
94// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • registry/100xui/blocks/motion-link/components/motion-link.tsx

Facts

Registry
100xui
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on 100xui 100xui.com YashwantOstwal/100xUI on GitHub Raw registry item This item as JSON

More from 100xui

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Apple galleryapple-gallery100xuiBlocksFree1 dep
Chat bento cardchat-bento-card100xuiBlocksFree1 dep
demosdemos100xuiBlocksFreeno deps · 12 files
In-page navbarin-page-navbar100xuiBlocksFree1 dep · 2 files
internalsinternals100xuiBlocksFreeno deps · 4 files
iPhone 3D mockupiphone-3d-mockup100xuiBlocksFreeno deps
Menu wheelmenu-wheel100xuiBlocksFree1 dep
Morph modalmorph-modal100xuiBlocksFree1 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