PHPackages                             sura/menu - 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. sura/menu

ActiveLibrary

sura/menu
=========

The Sura menu.

1.2.1(5y ago)022MITPHPPHP ^8.0

Since Dec 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Sura-framework/sura-menu)[ Packagist](https://packagist.org/packages/sura/menu)[ RSS](/packages/sura-menu/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

sura-menu
=========

[](#sura-menu)

Menu Generator
--------------

[](#menu-generator)

The `sura/menu` The package provides a fluent interface to build menus of any size in your php application.

Human Readable, Fluent Interface
--------------------------------

[](#human-readable-fluent-interface)

All classes provide a human readable, fluent interface (no array configuration). Additionally, you can opt for a more verbose and flexible syntax, or for convenience methods that cover most use cases.

```
Menu::new()
    ->add(Link::to('/', 'Home'))
    ->add(Link::to('/about', 'About'))
    ->add(Link::to('/contact', 'Contact'))
    ->add(Html::empty())
    ->render();

// Or just...
Menu::new()
    ->link('/', 'Home')
    ->link('/about', 'About')
    ->link('/contact', 'Contact')
    ->empty()
```

```

    Home
    About
    Contact

```

Or a More Programmatic Approach
-------------------------------

[](#or-a-more-programmatic-approach)

Menus can also be created through a reduce-like callable.

```
$pages = [
    '/' => 'Home',
    '/about' => 'About',
    '/contact' => 'Contact',
];

Menu::build($pages, function ($menu, $label, $url) {
    $menu->add($url, $label);
})->render();
```

```

    Home
    About
    Contact

```

Strong Control Over the Html Output
-----------------------------------

[](#strong-control-over-the-html-output)

You can programatically add html classes and attributes to any item in the menu, or to the menu itself.

```
Menu::new()
    ->addClass('navigation')
    ->add(Link::to('/', 'Home')->addClass('home-link'))
    ->add(Link::to('/about', 'About'))
    ->add(Link::to('/contact', 'Contact')->addParentClass('float-right'))
    ->wrap('div.wrapper')
```

```

        Home
        About
        Contact

link('/', 'Home')
    ->submenu('More', Menu::new()
        ->addClass('submenu')
        ->link('/about', 'About')
        ->link('/contact', 'Contact')
    );
```

```

    Home

        More

            About
            Contact

```

Install
-------

[](#install)

You can install the package via composer:

```
composer require sura/menu
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Total

4

Last Release

1905d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6cdac9e4390ea15486f926c4a89f4c02020954be51c17d5886299b5b83d75ecf?d=identicon)[semyon492](/maintainers/semyon492)

---

Top Contributors

[![semyon492](https://avatars.githubusercontent.com/u/22177963?v=4)](https://github.com/semyon492 "semyon492 (28 commits)")

---

Tags

menunavigation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sura-menu/health.svg)

```
[![Health](https://phpackages.com/badges/sura-menu/health.svg)](https://phpackages.com/packages/sura-menu)
```

###  Alternatives

[spatie/menu

Html menu generator

7592.9M6](/packages/spatie-menu)[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[kartik-v/yii2-widget-sidenav

An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)

364.0M8](/packages/kartik-v-yii2-widget-sidenav)[caffeinated/menus

Laravel Menus

134159.5k5](/packages/caffeinated-menus)[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
