Stackbits
Buttons > Navigation Button

Navigation Button

A navigation button is an interactive UI element that allows users to move between different sections or pages of a website or application. It enhances user experience by providing quick and intuitive access to essential features or destinations.

Preview

Follow below steps 👇🏻

Component

Create a file navigation-button.tsx in your components folder and paste this code

1
import React from 'react';
2
import { ArrowUpRight } from 'lucide-react';
3
4
interface ButtonProps {
5
children: React.ReactNode;
6
href: string;
7
target?: '_self' | '_blank' | '_parent' | '_top';
8
className?: string;
9
icon?: React.ReactNode;
10
}
11
12
const NavigationButton: React.FC<ButtonProps> = ({
13
children,
14
href,
15
target = '_self',
16
className,
17
icon
18
}) => {
19
return (
20
<a
21
href={href}
22
target={target}
23
className={`w-min inline-flex items-center gap-2 px-6 py-3 font-semibold text-white bg-gray-900 border border-gray-700 shadow-lg transition-all duration-200 ease-in-out hover:bg-gray-800 active:scale-95 focus:outline-none ${className}`}
24
>
25
{children}
26
{icon || <ArrowUpRight size={20} />}
27
</a>
28
);
29
};
30
31
export default NavigationButton;

Usage

1
<NavigationButton
2
href="your_link_here"
3
target="_blank"
4
className="text-lg md:text-xl font-medium rounded-xl !px-5 sm:!px-10 py-4"
5
>
6
Continue
7
</NavigationButton>

⭐️ Got a question or feedback?
Feel free to reach out!