Application menu bar.
https://luna.liriliri.io/?path=/story/menu-bar
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-menu/luna-menu.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-menu-bar/luna-menu-bar.css" />
<script src="//cdn.jsdelivr.net/npm/luna-menu/luna-menu.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-menu-bar/luna-menu-bar.js"></script>
You can also get it on npm.
npm install luna-menu-bar luna-menu --save
import 'luna-menu/luna-menu.css'
import 'luna-menu-bar/luna-menu-bar.css'
import LunaMenuBar from 'luna-menu-bar'
const container = document.getElementById('container')
const menuBar = new LunaMenuBar(container)
menuBar.append({
label: 'File',
submenu: LunaMenu.build([
{
label: 'Exit',
click() {
console.log('Exit clicked')
}
}
])
})
Append menu item.
Insert menu item to given position.
Create menu bar from template.
- label(string): Menu label.
- submenu(LunaComponent): Sub menu.