PHPackages                             jainilnagar/navkit - 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. jainilnagar/navkit

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

jainilnagar/navkit
==================

A full-featured navigation and menu builder for Craft CMS — multi-site, structured, translation-ready.

1.0.0(3d ago)01↓100%mitPHP &gt;=8.2

Since Jul 5Compare

[ Source](https://github.com/jainilnagar/craft-navkit)[ Packagist](https://packagist.org/packages/jainilnagar/navkit)[ RSS](/packages/jainilnagar-navkit/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

 [![Navkit icon](src/icon.svg)](src/icon.svg)

Navkit for Craft CMS
====================

[](#navkit-for-craft-cms)

A full-featured navigation and menu builder for Craft CMS 5 — multi-site, structured, translation-ready, with live-resolving links, per-menu custom fields, a cached front-end renderer, and GraphQL support.

Requirements
------------

[](#requirements)

- Craft CMS 5.0.0+
- PHP 8.2+

Installation
------------

[](#installation)

You can install Navkit via the plugin store, or through Composer.

### Composer

[](#composer)

You can also add the package to your project using Composer and the command line.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to require the plugin, and Craft to install it:

    ```
     composer require jainilnagar/navkit && php craft plugin/install navkit

    ```

### Craft Plugin Store

[](#craft-plugin-store)

To install Navkit, navigate to the Plugin Store section of your Craft control panel, search for Navkit.

Concepts
--------

[](#concepts)

- **Menu** — a container definition (name, handle, max nesting levels, site settings, and an optional custom field layout for its nodes). Stored in project config so it deploys across environments.
- **Node** — an item within a menu, living in a Craft Structure (so nodes nest as a drag-and-drop tree). Each node links somewhere via a **link type**.

### Link types

[](#link-types)

A node points somewhere through one of the built-in link types — **URL**, **Entry**, **Category**, **Asset**, **Product** (when Craft Commerce is installed), or **Passive** (a label with no link). Element links resolve their URL *live* at render time, so when a linked entry's slug or URI changes, the menu updates automatically.

Add your own link types by listening for `LinkTypes::EVENT_REGISTER_LINK_TYPES`.

Rendering
---------

[](#rendering)

The quickest path is the `render()` helper, which outputs a complete nested ``:

```
{{ craft.navkit.render('main') }}
```

Options:

```
{{ craft.navkit.render('main', {
    class: 'site-nav',
    navClass: 'primary',
    maxDepth: 2,
    template: 'nav/custom',
}) }}
```

The default markup is unstyled but carries hook classes — `navkit-nav`, `navkit-item`, `navkit-item--has-children`, `is-active`, `is-active-trail` — plus `aria-current="page"` on the current item, so you style it in CSS.

To customize the markup, either pass a `template` path, or copy the plugin's templates into your own project at `templates/navkit/_nav/menu.twig` and `templates/navkit/_nav/nodes.twig` — your copies take precedence.

### Raw access

[](#raw-access)

For full control over the markup, query nodes directly and let the `{% nav %}` tag walk the tree. `craft.navkit.nodes('handle').all()` returns the nodes in structure order, and each node exposes `isCurrent()` (this node matches the current URL), `isActive()` (this node or a descendant is current), `newWindow`, and `linkUrl`:

```
{% set nodes = craft.navkit.nodes('main').all() %}

        {% nav node in nodes %}

                {% if node.linkUrl %}
                    {{ node.title }}
                {% else %}
                    {{ node.title }}
                {% endif %}

                {% ifchildren %}
                    {% children %}
                {% endifchildren %}

        {% endnav %}

```

Don't add `.level(1)` when using `{% nav %}` — the tag needs the full structure-ordered list to build the nesting.

### Mega-menus &amp; custom node fields

[](#mega-menus--custom-node-fields)

`render()` outputs the standard menu — link text, hierarchy, and active states. It works from a lightweight cached tree (`id`, `title`, `url`, `type`, `target`, `newWindow`, `classes`, `rel`, `children`), which deliberately does **not** include a node's custom field values. So any richer, custom-field-driven output — mega-menu panels, promo columns, images, descriptions — will not appear through `render()`.

To render that content, use the raw `craft.navkit.nodes()` accessor instead, which returns full `Node` elements. Any field you've added to the menu's node field layout is then available as `node.`:

```
{% set nodes = craft.navkit.nodes('main').all() %}

{% nav node in nodes %}

        {{ node.title }}

        {# custom fields from the menu's node field layout, e.g. a field you added with handle "megaMenu" #}
        {% if node.megaMenu is defined and node.megaMenu %}
            {{ node.megaMenu }}
        {% endif %}

        {% ifchildren %}{% children %}{% endifchildren %}

{% endnav %}
```

In short: `render()` for the standard menu; `craft.navkit.nodes()` in your own template for mega-menus and anything driven by custom node fields.

Caching
-------

[](#caching)

Rendered menu trees are cached per menu + site (enabled by default; toggle under **Settings → Plugins → Navkit**). The active-trail is computed per request, so the cache doesn't fragment by URL. Caches invalidate automatically when a node changes — or when an element a node links to changes — so a linked entry's slug change refreshes the menu with no manual clear.

GraphQL
-------

[](#graphql)

Query a menu as a nested tree with resolved URLs:

```
{
  navkitMenu(handle: "main") {
    id
    title
    nodeUrl
    nodeType
    newWindow
    children {
      title
      nodeUrl
    }
  }
}
```

Arguments: `handle` (required), and optionally `site` (site handle) or `siteId`.

Permissions
-----------

[](#permissions)

- **Manage menu nodes** (`navkit:manageNodes`) — create/edit/reorder nodes.
- **Manage menus** (`navkit:manageMenus`) — create/edit/delete menu definitions and their field layouts.

License
-------

[](#license)

Navkit is licensed under the MIT License. See [LICENSE.md](LICENSE.md).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56784985?v=4)[Jainil Nagar](/maintainers/jainilnagar)[@jainilnagar](https://github.com/jainilnagar)

---

Tags

menucmsCraftcraftcmscraft-pluginnavigationmenus

### Embed Badge

![Health badge](/badges/jainilnagar-navkit/health.svg)

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

###  Alternatives

[verbb/navigation

Create navigation menus for your site.

92705.0k18](/packages/verbb-navigation)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k71](/packages/verbb-formie)[studioespresso/craft-navigate

Navigation plugin for Craft CMS

2643.2k2](/packages/studioespresso-craft-navigate)[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)

PHPackages © 2026

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