🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

tailwind-header-tabs

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-header-tabs

`HeaderTabs` is a customizable and accessible React component for displaying tabbed navigation with optional icons, count badges, and multi-tab selection via an auto-complete input.

1.0.11
latest
Source
npm
Version published
Weekly downloads
77
-25.24%
Maintainers
1
Weekly downloads
 
Created
Source

HeaderTabs Component

HeaderTabs is a customizable and accessible React component for displaying tabbed navigation with optional icons, count badges, and multi-tab selection via an auto-complete input.

🛠 Tailwind CSS Setup

⚠️ This component library uses Tailwind CSS utility classes but does not include TailwindCSS by default.
You must have TailwindCSS configured in your own project for styles to apply correctly.

✨ Features

  • Customizable icons (function or object)
  • Custom badges per tab
  • Smooth scroll to selected tab
  • Multi-tab selection (optional)
  • Auto-complete search for tab selection

🛠 Tailwind Setup

To use this component library with Tailwind, add the following to your tailwind.config.js:

module.exports = {
  content: ["...", "./node_modules/tailwind-header-tabs/**/*.{js,jsx}"],
  // other config...
};

Data Structure

The tabs prop should follow a recursive { id: string; label: string }[] format, allowing unlimited levels of nesting.

Example:

const tabs = [
  { id: "1", label: "Apple" },
  { id: "car", label: "Car" },
  { id: "box", label: "Box" },
];

Props

NameTypeRequiredDefaultDescription
tabsTab[] (i.e., { id: string; label: string }[])List of all tabs.
activeTabTab | nullCurrently selected tab.
onClickTab(tab: Tab) => voidCallback when a tab is clicked.
showCountBadgesbooleanShow numeric badges beside tab labels.
countLabelRecord<string, number>{}Mapping of tab label to count badge.
iconsRecord<string, React.ReactNode> | (color?: string, className?: string) => Record<string, React.ReactNode>undefinedIcons for tabs. Can be a static map or function that returns icons.
activeIconColorstring"#2563eb"Color used for active tab icons.
inactiveIconColorstring"#6b7280"Color used for inactive tab icons.
selectablebooleanfalseEnables selecting multiple tabs using auto-complete input.

Keywords

react

FAQs

Package last updated on 29 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts