• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created almost 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

x mega menu is repsonsive mega menu based on vannilajs


X-MEGA_MENU
X Mega Menu

X-Mega-Menu

x mega menu is easy usable multi level responsive with vanillaJS very fast and without any dependencies (ltr and rtl support).

How use it?

With package manager:

npm i x-mega-menu

or

yarn add x-mega-menu

or you can use CDN package:

CSS ⬇️

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/x-mega-menu.min.css">

JavaScript ⬇️

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/x-mega-menu.min.js"></script>

add assets:

   <link rel="stylesheet" href="x-mega-menu/dist/x-mega-menu.min.css">
   <script src="x-mega-menu/dist/x-mega-menu.min.js"></script>

HTML:

<nav>
    <ul id="mega-menu">
        <li>
            <a href="#">
                <img src="https://assets.ubuntu.com/v1/ff6a9a38-ubuntu-logo-2022.svg" alt="">
            </a>
        </li>
        <li>
            <a href="#">
                menu item 1
            </a>
            <ul>
                <li>
                    <h3>
                        sub item 1
                    </h3>
                    <ul>
                        <li><a href="#">sub sub item 01</a></li>
                        <li><a href="#">sub sub item 02</a></li>
                        <li><a href="#">sub sub item 03</a></li>
                        <li><a href="#">sub sub item 04</a></li>
                        <li><a href="#">sub sub item 05</a></li>
                    </ul>
                </li>
                <li>
                    <h3>
                        sub item 2
                    </h3>
                    <ul>
                        <li><a href="#">sub sub item 01</a></li>
                        <li><a href="#">sub sub item 02</a></li>
                        <li>
                            <a href="#">sub sub item 03 has</a>
                            <ul>
                                <li><a href="#">sub sub sub item 001</a></li>
                                <li><a href="#">sub sub sub item 002</a></li>
                                <li><a href="#">sub sub sub item 003</a></li>
                                <li>
                                    <a href="#">
                                        sub sub sub item 004 has sub
                                    </a>
                                    <ul>
                                        <li><a href="#">sub sub sub item 001</a></li>
                                        <li><a href="#">sub sub sub item 002</a></li>
                                        <li><a href="#">sub sub sub item 003</a></li>
                                        <li><a href="#">sub sub sub item 004</a></li>
                                        <li><a href="#">sub sub sub item 005</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#">sub sub sub item 005 has too</a>
                                    <ul>
                                        <li><a href="#">sub sub sub item 001</a></li>
                                        <li><a href="#">sub sub sub item 002</a></li>
                                        <li><a href="#">sub sub sub item 003</a></li>
                                        <li><a href="#">sub sub sub item 004</a></li>
                                        <li><a href="#">sub sub sub item 005</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li><a href="#">sub sub item 04</a></li>
                        <li><a href="#">sub sub item 05</a></li>
                    </ul>
                </li>
                <li>
                    <h3>
                        sub item 3
                    </h3>
                    <img src="https://assets.ubuntu.com/v1/ff6a9a38-ubuntu-logo-2022.svg" alt="">
                </li>
                <li class="x-highlight">
                    <h3>
                        This highlight section
                    </h3>
                    <br>
                    <p>
                        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi autem doloremque ducimus enim
                        est et facilis iusto laboriosam magni molestiae molestias nesciunt obcaecati optio possimus
                        quam, quidem quos repudiandae sunt.
                    </p>
                </li>
            </ul>
        </li>
        <li>

            menu item 2

            <ul>
                <li>
                    <h3>
                        sub item 1
                    </h3>
                    <ul>
                        <li><a href="#">sub sub item 01</a></li>
                        <li><a href="#">sub sub item 02</a></li>
                        <li><a href="#">sub sub item 03</a></li>
                        <li><a href="#">sub sub item 04</a></li>
                        <li><a href="#">sub sub item 05</a></li>
                    </ul>
                </li>
                <li>
                    <h3>
                        sub item 3
                    </h3>
                    <img src="https://assets.ubuntu.com/v1/ff6a9a38-ubuntu-logo-2022.svg" alt="">
                </li>
                <li>
                    <h3>
                        sub item 1
                    </h3>
                    <ul>
                        <li><a href="#">sub sub item 01</a></li>
                        <li><a href="#">sub sub item 02</a></li>
                        <li><a href="#">sub sub item 03</a></li>
                        <li><a href="#">sub sub item 04</a></li>
                        <li><a href="#">sub sub item 05</a></li>
                    </ul>
                </li>

                <li class="x-highlight">
                    <h3>
                        This highlight section
                    </h3>
                    <br>
                    <p>
                        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi autem doloremque ducimus enim
                        est et facilis iusto laboriosam magni molestiae molestias nesciunt obcaecati optio possimus
                        quam, quidem quos repudiandae sunt.
                    </p>
                </li>

            </ul>
        </li>
        <li>
            <a href="#">
                menu item 3
            </a>
        </li>
        <li>
            <a href="#">
                menu item 4
            </a>
        </li>
        <li>
            <a href="#">
                menu item 3
            </a>
        </li>
        <li>
            menu item 4
        </li>
        <li class="x-always-show x-small">
            🔍
        </li>
    </ul>
</nav>

javascript use:

xMegaMenu('#mega-menu', {
    responseWidth: 1124,
    isRtl: true,
    mainTitle: '🖤 xStack menu 🖤',
    blurEffect: true,
    disableLinks: true,
    fixedTop: true,
    onCloseSideMenu: function () {
        console.log('closed');
    },
    onOpenSideMenu: function () {
        console.log('opened');
    }
});

webpack or vite (vuejs or reactjs) usage

  1. import css or scss
@import "~x-mega-menu/src/x-mega-menu";
  1. import js and use it
import xMegaMenu from 'x-mega-menu/dist/x-mega-menu';
xMegaMenu('#mega-menu', {
   // options  
});

Screenshots

Mega Menu Style

Blue Theme

Red Theme

Dark Theme

🔗 Links

https://www.npmjs.com/package/x-tree-select
http://4xmen.ir/
https://xstack.ir

DEMO (example)

option and events

name default action
responseWidth 1024 active mobile mode (side menu)
barsIcon - any html element use for toggle bar
mainTitle Navbar menu change main menu title
isRtl false change direction to rtl
blurEffect false blur effect when menu active
resetMenu true reset side menu when close
disableLinks true disable links when has sub menu click event otherwise on mouse enter show sub level

###events

name action
onCloseSideMenu Trigger when side menu open
onOpenSideMenu Trigger when side menu close

Theme

  • Dark
  • Red
  • Blue
  • gray
  • customizable theme as you want

Report Some Bugs

Find a Bug? Please, create an issue and we'll fix it together for a better template.

Contribution

Contribution are always welcome and recommended! Here is how:

Developing project

Dependencies are node-sass and minify

To render css:

npm run scss

To build:

npm run build

Badges

X-Mega-Menu GitHub Xstack 4xmen Devefun

License

GPLv3 License

GPL

Support

Star Repo If Like It ...

Developed With Love ! ❤️

More Repositories

1

anubias

Developed mobile apps so easy and native with GUI 📱
Vue
2,114
star
2

Get-Github-Achievements

How to Get GitHub Achievements, Step by Step ; Translated to Persian 🇮🇷, Deutsche 🇩🇪, France 🇫🇷, Russian 🇷🇺, Turkish 🇹🇷, Dutch 🇳🇱, Chinese 🇨🇳, Spanish 🇪🇸, Arabic 🇸🇦, Indonesian 🇮🇩, Japanese 🇯🇵, Hindi 🇮🇳, Swahili 🇰🇪, Armenia 🇦🇲 Guide.
1,035
star
3

v2ray-script

Bridge and upstream server
Shell
648
star
4

laravel-form-builder

The laravel form builder code generator
JavaScript
578
star
5

Web-Package-RTL

⚡ Full RTL Package - Bootstrap Responsive Components For Iranian's 🇮🇷
HTML
543
star
6

pm2panel

pm2 web control panel to manager process with web ui
JavaScript
433
star
7

xshop

Very customizable and easy to use shopping system, open source project based on laravel
PHP
340
star
8

Anubias-Doc

Anubias Documations
HTML
157
star
9

starterkit-for-laravel

An Starter Kit For Laravel Projects.
PHP
147
star
10

xstack-v2ray-installer

A script for easy installation of x-ui panel by xstack team
Shell
132
star
11

x-tree-select

Tree Select jQuery plugin
JavaScript
92
star
12

persian-json-placeholder

persian json placeholder for front-end developer & mobile developrs
PHP
83
star
13

x-ui

xray panel supporting multi-protocol multi-user expire day & traffic (Vmess & Vless) and IP Restriction
JavaScript
73
star
14

radepa-x-ui

JavaScript
71
star
15

mpdatepicker

Materialize Persian Datepicker
JavaScript
69
star
16

rvnm

Responsive vertical navigation menu
CSS
60
star
17

README.BOX

🔝 Here, the best REAMDE profiles and the best tools for creating a good README are listed. You can choose and use the best according to your taste and preferences. 🎨
46
star
18

lput

Laravel Persian UI Toolkits
Vue
31
star
19

EloquentPlus

Laravel elequent for javascript/nodejs :)
JavaScript
26
star
20

fsei

flutter super easy installer, install flutter with one click and one command
Shell
25
star
21

TGBP

Telegram Bot SDK with Pascal
Pascal
24
star
22

parallax_image

Parallax scrolling effect for image
Dart
23
star
23

owasp-threat-dragon-gitlab

JavaScript
22
star
24

LipoLid

This script automates the installation of Laravel dependencies and creates projects from GitHub. It checks and installs missing dependencies, clones GitHub repositories, installs dependencies using Composer, and handles project setup tasks. Efficiently sets up Laravel projects in a streamlined manner.
Shell
22
star
25

flutter-gui

flutter gui generator
21
star
26

loremfa

Enhance your JetBrains IDE with Loremfa, the ultimate Persian text generation plugin for developers and content creators. Streamline coding, documentation, and content creation with seamless Persian language support.
Kotlin
18
star
27

Python_Learning

17
star