PHPackages                             hdaklue/naptab - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hdaklue/naptab

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hdaklue/naptab
==============

NapTab, A Laravel Livewire package for intelligent tabbed navigation with true lazy loading. Tabs stay asleep until activated, waking only when needed.

1.0.23(9mo ago)523MITPHPPHP ^8.1

Since Sep 9Pushed 9mo agoCompare

[ Source](https://github.com/hdaklue/naptap)[ Packagist](https://packagist.org/packages/hdaklue/naptab)[ RSS](/packages/hdaklue-naptab/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (6)Versions (25)Used By (0)

NapTab
======

[](#naptab)

[![Latest Version on Packagist](https://camo.githubusercontent.com/541fe6379b85fd86acb8146f2c8ce631585e21b995f2599cb1d2c8025103437f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6864616b6c75652f6e61707461622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hdaklue/naptab)[![Total Downloads](https://camo.githubusercontent.com/1895bbdbef583226b4c78107cd562859587f73f4fda3db1ee7ee7d6c901e0142/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6864616b6c75652f6e61707461622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hdaklue/naptab)[![GitHub Tests Action Status](https://camo.githubusercontent.com/20e6a602fef91061f6e7ba1753a0870cb5598ced4d02c0fcf8d107fa2a42c3c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6864616b6c75652f6e61707461622f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/hdaklue/naptab/actions?query=workflow%3Atests+branch%3Amain)

**Stop waiting. Start loading smart.**

Transform your Laravel applications with intelligent tabbed navigation that only loads what users actually need. NapTab eliminates the performance bottleneck of traditional tabs by implementing true lazy loading - heavy database queries and expensive operations execute only when users click tabs, not during initial page load.

Featuring an innovative **dual-level content hooks system** that lets you inject content both around individual tabs and the entire container, plus flexible layout directions including modern aside/sidebar layouts for professional dashboard-style interfaces.

**The result? 4x faster page loads, unprecedented customization, and happier users.**

Table of Contents
-----------------

[](#table-of-contents)

- [Why Developers Choose NapTab](#why-developers-choose-naptab)
- [Key Benefits &amp; Performance Impact](#key-benefits--performance-impact)
- [Quick Start (2 Minutes)](#get-started-in-2-minutes)
- [Perfect Use Cases](#perfect-for-your-use-case)
- [Content Hooks System (NEW)](#revolutionary-content-hooks-system)
- [Advanced Usage &amp; API Reference](#advanced-usage--api-reference)
- [Professional Theming &amp; Configuration](#professional-theming--configuration)
- [Installation Guide](#installation-guide)
- [Mobile Navigation](#mobile-navigation)
- [URL Routing](#url-routing)
- [CSS Customization](#css-customization)
- [Why Laravel Developers Love NapTab](#why-laravel-developers-love-naptab)
- [Contributing &amp; Support](#contributing--support)

Why Developers Choose NapTab
----------------------------

[](#why-developers-choose-naptab)

### The Performance Problem

[](#the-performance-problem)

Traditional tab implementations load all content immediately, creating unnecessary database queries and bloated page loads. Your users wait longer, your servers work harder, and your application feels sluggish.

### The NapTab Solution

[](#the-naptab-solution)

**True Lazy Loading Architecture**: Each tab remains "asleep" until clicked, eliminating wasted resources and dramatically improving perceived performance.

---

Key Benefits &amp; Performance Impact
-------------------------------------

[](#key-benefits--performance-impact)

### 🎯 **Dual-Level Content Hooks System (UNIQUE)**

[](#-dual-level-content-hooks-system-unique)

- **Container-level hooks**: Inject content around entire tabs container
- **Tab-level hooks**: Add headers, footers, and alerts to individual tabs
- **Multiple content types**: Support for strings, Views, Closures, and Htmlable objects
- **Dynamic rendering**: Hooks evaluate only when tabs are accessed
- **Unmatched flexibility**: No other Laravel tab package offers this level of customization

### ⚡ **Instant Performance Gains**

[](#-instant-performance-gains)

- **4x faster page loads** (340ms → 80ms average improvement)
- Zero database queries for inactive tabs
- Reduced server load and memory usage
- Better Core Web Vitals scores

### 📱 **Mobile-Optimized Experience**

[](#-mobile-optimized-experience)

- Intelligent navigation that adapts to screen size
- **Responsive Layout Directions**: Choose between traditional horizontal tabs or modern aside/sidebar layouts that automatically optimize for mobile
- Touch-friendly interactions with smooth animations
- Bottom-sheet modal or horizontal scroll options
- Perfect for responsive Laravel applications

 [![NapTab Mobile Interface](artwork/1.png)](artwork/1.png) [![NapTab Mobile Tab Selector](artwork/2.png)](artwork/2.png)
 *Mobile-optimized interface with smooth animations and touch-friendly navigation*

### 🌐 **Global-Ready**

[](#-global-ready)

- Complete RTL support for Arabic, Hebrew, Persian
- Automatic text direction detection
- Cultural UI patterns respected

### 🔗 **SEO &amp; UX Friendly**

[](#-seo--ux-friendly)

- Bookmarkable tabs with clean URLs
- Browser back/forward navigation support
- Search engine friendly content organization

### 🎨 **Production-Ready Theming**

[](#-production-ready-theming)

- 22 professionally designed color schemes
- Dark/light mode support
- 4 visual presets: Modern, Minimal, Sharp, Pills
- Fully customizable via Tailwind CSS

### 🔧 **Laravel Ecosystem Integration**

[](#-laravel-ecosystem-integration)

- Works seamlessly with FilamentPHP admin panels
- Compatible with any Livewire components
- Integrates with traditional Blade views
- Zero conflicts with existing packages

Real-World Performance Impact
-----------------------------

[](#real-world-performance-impact)

### Before vs After NapTab

[](#before-vs-after-naptab)

MetricTraditional TabsWith NapTabImprovement**Initial Page Load**340ms80ms**4x faster****Database Queries**All tabs loadedOnly active tab**75% reduction****Memory Usage**All components activeLazy instantiation**60% lighter****Time to Interactive**800ms200ms**4x faster**### Why This Matters for Your Business

[](#why-this-matters-for-your-business)

- **Improved User Experience**: Users see content immediately instead of waiting for unnecessary data
- **Reduced Server Costs**: Fewer database queries mean lower infrastructure costs
- **Better SEO Rankings**: Google rewards faster page loads with higher search rankings
- **Higher Conversion Rates**: Every 100ms improvement increases conversions by 1%

### Technical Performance Features

[](#technical-performance-features)

- ✅ **Smart Lazy Loading**: Database queries execute only when tabs are accessed
- ✅ **Efficient DOM Management**: Strategic Livewire component instantiation
- ✅ **Zero-Reload Navigation**: URL updates without full page refreshes
- ✅ **Mobile-Optimized**: Minimal JavaScript footprint for mobile devices
- ✅ **Configuration Caching**: Theme settings cached for production performance

Get Started in 2 Minutes
------------------------

[](#get-started-in-2-minutes)

### 1. Install NapTab

[](#1-install-naptab)

```
composer require hdaklue/naptab
php artisan naptab:install
```

The install command automatically:

- Creates your configuration provider
- Publishes CSS assets
- Registers the service provider
- Sets up Tailwind safelist classes

### 2. Create Your First Tab Component

[](#2-create-your-first-tab-component)

Generate a new tabbed component extending NapTab:

```
