BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/motion-primitives/border-trail

Border Trail

motion-primitives/border-trail
FreeComponent

An effect that creates animated border trails around elements on interaction.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/ibelick/motion-primitives/HEAD/public/c/border-trail.json

Source

border-trail.tsxraw.githubusercontent.com/ibelick/motion-primitives/HEAD/public/c/border-trail.json
1'use client';
2import { cn } from '@/lib/utils';
3import { motion, Transition } from 'motion/react';
4
5export type BorderTrailProps = {
6 className?: string;
7 size?: number;
8 transition?: Transition;
9 onAnimationComplete?: () => void;
10 style?: React.CSSProperties;
11};
12
13export function BorderTrail({
14 className,
15 size = 60,
16 transition,
17 onAnimationComplete,
18 style,
19}: BorderTrailProps) {
20 const defaultTransition: Transition = {
21 repeat: Infinity,
22 duration: 5,
23 ease: 'linear',
24 };
25
26 return (
27 <div className='pointer-events-none absolute inset-0 rounded-[inherit] border border-transparent [mask-clip:padding-box,border-box] [mask-composite:intersect] [mask-image:linear-gradient(transparent,transparent),linear-gradient(#000,#000)]'>
28 <motion.div
29 className={cn('absolute aspect-square bg-zinc-500', className)}
30 style={{
31 width: size,
32 offsetPath: `rect(0 auto auto 0 round ${size}px)`,
33 ...style,
34 }}
35 animate={{
36 offsetDistance: ['0%', '100%'],
37 }}
38 transition={transition || defaultTransition}
39 onAnimationComplete={onAnimationComplete}
40 />
41 </div>
42 );
43}

What it pulls in

npm packages

  • motion

Files it writes

  • components/core/border-trail.tsx

Facts

Registry
motion-primitives
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
2 days ago

Go to the source

motion-primitives.com ibelick/motion-primitives on GitHub Raw registry item This item as JSON

More from motion-primitives

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionmotion-primitivesComponentsFree1 dep
Animated Backgroundanimated-backgroundmotion-primitivesComponentsFree1 dep
Animated Groupanimated-groupmotion-primitivesComponentsFree1 dep
Animated Numberanimated-numbermotion-primitivesComponentsFree1 dep
Carouselcarouselmotion-primitivesComponentsFree1 dep
Cursorcursormotion-primitivesComponentsFree1 dep
Dialogdialogmotion-primitivesComponentsFree1 dep · 2 files
Disclosuredisclosuremotion-primitivesComponentsFree1 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