Back to Component Explorer

Outline Button

buttons

Sleek editorial bordered button with expanding hover backdrop transition.

#button#outline#editorial#border
Live Interactive Preview

Component Source Code

Select language in the dropdown
OutlineButton.tsx
1'use client';
2
3import React from 'react';
4import { Compass } from 'lucide-react';
5
6export default function OutlineButton() {
7 return (
8 <button className="group relative inline-flex items-center gap-2 overflow-hidden rounded-xl border-2 border-slate-900 dark:border-slate-100 bg-transparent px-6 sm:px-7 py-2.5 sm:py-3 text-sm font-semibold text-slate-900 dark:text-slate-100 transition-all duration-300 hover:text-white dark:hover:text-slate-900">
9 <span className="absolute inset-0 -translate-x-full bg-slate-900 dark:bg-slate-100 transition-transform duration-300 ease-out group-hover:translate-x-0" />
10 <Compass className="relative z-10 h-4 w-4 transition-transform duration-300 group-hover:rotate-45" />
11 <span className="relative z-10">Editorial Border</span>
12 </button>
13 );
14}

Installation & Integration Guide

Step 1: Tailwind CSS v4 Setup
Tailwind Docs

If you do not have Tailwind installed yet, run this installation command:

Terminal
npm install tailwindcss @tailwindcss/postcss postcss

Then add the Tailwind directive to your main stylesheet (globals.css):

@import "tailwindcss";

Step 2: Install Icon Dependencies

npm install lucide-react react-icons

Step 3: Add Component File

Create a new file in your project at src/components/buttons/OutlineButton.tsx and paste the copied code from the source viewer above.

Step 4: Usage Example

ExamplePage.tsx
1import OutlineButton from '@/components/buttons/OutlineButton';
2
3export default function ExamplePage() {
4 return (
5 <main className="p-8 flex items-center justify-center min-h-screen">
6 <OutlineButton />
7 </main>
8 );
9}