π Moving Border Button
The Animated Border Button adds a sleek, moving border effect using CSS keyframes, making buttons more interactive and eye-catching. Perfect for call-to-action buttons and modern UIs, itβs lightweight, customizable, and seamlessly integrates into any project. Adjust speed, color, and thickness to match your design needs for a polished, dynamic touch.
Preview
Follow below steps ππ»
Component
Create a file moving-border-button.tsx in your components folder and paste this code
1import React from 'react';23const MovingBorderButton = ({4children,5wrapperClassName,6className,7onClick,8type = 'button'9}: {10children?: React.ReactNode;11wrapperClassName?: string;12className?: string;13onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;14type?: 'button' | 'submit' | 'reset';15}) => {16return (17<button18className={`moving-border-btn rounded-full p-[1px] ${wrapperClassName}`}19onClick={onClick}20type={type}21>22<div23className={`bg-black hover:bg-neutral-900 transition-all rounded-full px-2 py-1 flex items-center justify-center relative ${className}`}24>25{children}26</div>27</button>28);29};3031export default MovingBorderButton;
Usage
1<MovingBorderButton className="text-lg md:text-xl lg:text-3xl font-medium !px-5 sm:!px-10 py-4">2Join the speedforce3</MovingBorderButton>
βοΈ Got a question or feedback?
Feel free to reach out!