---
url: /reference/models/menu-node.md
---
# MenuNode

Hierarchical menu builder: each node links to a [Page](/reference/models/page), an [ExternalLink](/reference/models/external-link), or any custom linkable model.

## Columns

| Column | Type | Notes |
| --- | --- | --- |
| `key` | string | unique within its parent, optional |
| `title` / `label` | jsonb | translated texts |
| `parent_id` | bigint | tree hierarchy |
| `position` | integer | ordering among siblings |
| `linkable_type` / `linkable_id` | string / bigint | polymorphic target |
| `icon_key` | string | optional [icon](/reference/icons) |
| `modifiers` | string | styling flags |

## Behavior

* `has_closure_tree` for the hierarchy, [Orderable](/reference/concerns/orderable) for positions
* `belongs_to :linkable, polymorphic: true, optional: true`
* Includes [Translatable](/reference/concerns/translatable) and `strip_attributes`

## Notable methods

| Method | Returns |
| --- | --- |
| `to_s` | title, label or key |
| `to_param` | key or id |
| `icon?` / `icon` | whether an icon is set / the `IconComponent` for it |
| `external_link?` | whether the target is an `ExternalLink` |
