Skip to content

shuxx/filament-navigation

Repository files navigation

Filament Navigation

Filament Navigation Banner

Latest Version Total Downloads License Tests PHPStan

Configure your Filament navigation via a simple PHP configuration file - no manual navigation building required!

Perfect for applications where navigation needs to be easily manageable, version-controlled, and consistent across environments.


✨ Features

  • βœ… Simple Configuration - Define navigation in a clean PHP config file
  • βœ… Full Control - Groups, direct links, and visual separators
  • βœ… 24 Separator Styles - From classic lines to hearts and stars
  • βœ… Order Preservation - Array order = display order
  • βœ… External Links - Support for external URLs with target="_blank"
  • βœ… Icon Support - Full Heroicon support for groups and items
  • βœ… No Hover on Separators - Automatically disables hover effects
  • βœ… Filament 4 Compatible - Built specifically for Filament 4.x

πŸ“¦ Installation

Install via composer:

composer require shuxx/filament-navigation

Publish the configuration file:

php artisan vendor:publish --tag="filament-navigation-config"

This creates config/filament-navigation.php.

πŸš€ Quick Start

1. Register the plugin

In app/Providers/Filament/AdminPanelProvider.php:

use Shuxx\FilamentNavigation\FilamentNavigationPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(FilamentNavigationPlugin::make());
}

2. Configure your navigation

Edit config/filament-navigation.php:

return [
    'items' => [
        // Dashboard
        [
            'type' => 'link',
            'label' => 'Dashboard',
            'url' => '/admin',
            'icon' => 'heroicon-o-home',
        ],

        // Separator
        ['type' => 'separator', 'style' => 'default'],

        // Users Group
        [
            'type' => 'group',
            'label' => 'Users',
            'icon' => 'heroicon-o-user-group',
            'collapsible' => true,
            'items' => [
                ['type' => 'link', 'label' => 'All Users', 'url' => '/admin/users'],
                ['type' => 'link', 'label' => 'Roles', 'url' => '/admin/roles'],
            ],
        ],

        ['type' => 'separator', 'style' => 'dots'],

        // External link
        [
            'type' => 'link',
            'label' => 'Documentation',
            'url' => 'https://filamentphp.com/docs',
            'icon' => 'heroicon-o-book-open',
            'external' => true,
        ],
    ],
];

That's it! Your navigation is now configured. πŸŽ‰

πŸ“– Documentation

Available Types

Group

Creates a collapsible navigation group:

[
    'type' => 'group',
    'label' => 'Settings',
    'icon' => 'heroicon-o-cog-6-tooth',
    'collapsible' => true,  // optional, default: true
    'items' => [
        // ... sub-items
    ],
]

Link

Creates a navigation link:

[
    'type' => 'link',
    'label' => 'Dashboard',
    'url' => '/admin/dashboard',
    'icon' => 'heroicon-o-home',  // optional
    'external' => false,  // optional, opens in new tab if true
]

Separator

Creates a visual separator:

[
    'type' => 'separator',
    'style' => 'default',  // optional, see styles below
]

🎨 Separator Styles (24 options)

Classic Lines

  • default β†’ ───────────
  • long β†’ ────────────────
  • double β†’ ═══════════
  • thick β†’ ━━━━━━━━━━━
  • dash β†’ - - - - - - - -
  • underscore β†’ ___________

Dots and Circles

  • dots β†’ β€’ β€’ β€’ β€’ β€’ β€’ β€’ β€’
  • circle β†’ β—‹ β—‹ β—‹ β—‹ β—‹ β—‹
  • circle-filled β†’ ● ● ● ● ● ●
  • ellipsis β†’ β‹― β‹― β‹― β‹― β‹―

Geometric Shapes

  • square β†’ β–ͺ β–ͺ β–ͺ β–ͺ β–ͺ β–ͺ
  • diamond β†’ β—† β—† β—† β—† β—†
  • triangle β†’ β–Έ β–Έ β–Έ β–Έ β–Έ β–Έ
  • arrow β†’ β†’ β†’ β†’ β†’ β†’
  • chevron β†’ β€Ί β€Ί β€Ί β€Ί β€Ί β€Ί

Special Symbols

  • stars β†’ β˜… β˜… β˜… β˜… β˜…
  • hearts β†’ β™₯ β™₯ β™₯ β™₯ β™₯
  • plus β†’ + + + + + + +
  • cross β†’ βœ• βœ• βœ• βœ• βœ•

Waves and Curves

  • wave β†’ ~~~~~~~
  • wavy β†’ γ€°γ€°γ€°γ€°γ€°
  • zigzag β†’ ﹏﹏﹏﹏﹏

Spaces

  • space β†’ (large empty space)
  • blank β†’ Β· (minimal visible space)

Plugin Options

Disable Separator Hover

By default, separators have hover effects disabled. You can enable them:

FilamentNavigationPlugin::make()
    ->disableSeparatorHover(false)

⚠️ Important Notes

Filament 4 Icon Limitation

In Filament 4, you cannot have icons on both the group AND its items. Choose one:

Option 1 - Icons on groups (recommended):

[
    'type' => 'group',
    'icon' => 'heroicon-o-user-group',  // βœ… Icon here
    'items' => [
        ['label' => 'Users', 'url' => '...'],  // ❌ No icons
    ],
]

Option 2 - Icons on items:

[
    'type' => 'group',
    // ❌ No icon on group
    'items' => [
        ['label' => 'Users', 'icon' => 'heroicon-o-users'],  // βœ… Icons here
    ],
]

Navigation Order

The order of items in your config array is the display order. The plugin transforms everything into navigation groups internally to maintain order control (a Filament 4 requirement).

πŸ§ͺ Testing

composer test

πŸ“ Changelog

Please see CHANGELOG for recent changes.

πŸ“š Documentation

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING for details on:

  • Reporting bugs
  • Suggesting features
  • Submitting pull requests
  • Development guidelines

πŸ’¬ Support

Need help or have questions?

πŸ”’ Security

If you discover any security-related issues, please email the author directly instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

πŸ’ Credits

πŸ“„ License

The MIT License (MIT). Please see License File for more information.


Made with ❀️ for the Filament community

⭐ Star this repo if you find it helpful!

About

Configure Filament navigation via PHP config file - 24 separator styles, groups, links

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages