Navigation Menu

Navigation Menu

A collection of links for navigating websites.

Usage

Import the component. It's mandatory to wrap the whole component with the Tailwind tag.

const { Tailwind } = VM.require("uiisnear.near/widget/tailwind");
 
const {
  NavigationMenu,
  NavigationMenuContent,
  NavigationMenuItem,
  NavigationMenuLink,
  NavigationMenuList,
  NavigationMenuTrigger,
  navigationMenuTriggerClassname,
} = VM.require("uiisnear.near/widget/navigationMenu");
 
if (Tailwind == undefined) return "";
<Tailwind>
  <NavigationMenu>
    <NavigationMenuList>
      <NavigationMenuItem>
      <NavigationMenuTrigger>Item One</NavigationMenuTrigger>
      <NavigationMenuContent>
          <NavigationMenuLink>Link</NavigationMenuLink>
      </NavigationMenuContent>
      </NavigationMenuItem>
    </NavigationMenuList>
  </NavigationMenu>
</Tailwind>

API Reference

NavigationMenu

Contains all the parts of a navigation menu.

PropTypeDefault
defaultValue
string
---
value
string
---
onValueChange
function
---
delayDuration
number
200
skipDelayDuration
number
300
dir
enum
300
Data attributeValues
[data-orientation]"vertical" | "horizontal"

NavigationMenuList

Contains the top level menu items.

Data attributeValues
[data-orientation]"vertical" | "horizontal"

NavigationMenuItem

The button that toggles the content.

PropTypeDefault
value
string
---

NavigationMenuTrigger

The button that toggles the content.

Data attributeValues
[data-state]"open" | "closed"
[data-disabled]Present when disabled

NavigationMenuContent

Contains the content associated with each trigger.

PropTypeDefault
disableOutsidePointerEvents
boolean
false
onEscapeKeyDown
function
---
onPointerDownOutside
function
---
onFocusOutside
function
---
onInteractOutside
function
---
forceMount
boolean
---
Data attributeValues
[data-state]"open" | "closed"
[data-motion]"to-start" | "to-end" | "from-start" | "from-end"
[data-orientation]"vertical" | "horizontal"

NavigationMenuLink

A navigational link.

PropTypeDefault
active
boolean
false
onSelect
function
---
Data attributeValues
[data-active]Present when active

NavigationMenuIndicator

An optional indicator element that renders below the list, is used to highlight the currently active trigger.

PropTypeDefault
forceMount
boolean
---
Data attributeValues
[data-state]"visible" | "hidden"
[data-orientation]"vertical" | "horizontal"

NavigationMenuViewport

An optional viewport element that is used to render active content outside of the list.

PropTypeDefault
forceMount
boolean
---
Data attributeValues
[data-state]"open" | "closed"
[data-orientation]"vertical" | "horizontal"

Classnames

Classnames available to customize the component.

FunctionClassname
NavigationMenunavigationMenuClassname
NavigationMenuListnavigationMenuListClassname
NavigationMenuTriggernavigationMenuTriggerClassname
NavigationMenuContentnavigationMenuContentClassname
NavigationMenuViewportnavigationMenuViewportClassname
NavigationMenuIndicatornavigationMenuIndicatorClassname