Profile content goes here

Underline Tabs Component

A stylish underline tabs component with smooth animations, built with Framer Motion.

  • Clean underline animation when switching between tabs
  • Support for icons in tab triggers
  • Fully customizable content
  • Simple data-driven API

Installation

The UnderlineTabs component is part of our UI library. You can import it directly from the components directory.


Usage

Here is how to use underline tabs in your project:

React TSX
1import UnderlineTabs from "@/components/modern-ui/underline-tabs"
2import { Home, Settings, User } from "lucide-react"

React TSX
1const tabs = [
2  {
3    id: "profile",
4    label: "Profile",
5    icon: User,
6    content: <div>Profile content</div>
7  },
8  {
9    id: "dashboard",
10    label: "Dashboard",
11    icon: Home,
12    content: <div>Dashboard content</div>
13  },
14  {
15    id: "settings",
16    label: "Settings",
17    icon: Settings,
18    content: <div>Settings content</div>
19  }
20];
21
22<UnderlineTabs tabs={tabs} defaultTab="profile" />

Examples

Basic Underline Tabs

Tab 1 Content

This is the content for the first tab.

Tabs with Icons

Profile

View and edit your profile information.

Custom Styled Tabs

Messages

Your recent messages and conversations.


API Reference

Tab Object

Each tab is defined by a Tab object with the following properties:

PropertyTypeDescription
idstringUnique identifier for the tab
labelstringLabel text displayed on the tab
iconLucideIconOptional Lucide icon to display next to the label
contentReactNodeContent to render when the tab is active

UnderlineTabs Props

PropTypeDefaultDescription
tabsTab[]RequiredArray of tab objects
defaultTabstringFirst tab's IDID of the tab to show by default
classNamestring''Additional CSS classes