Navbar

Navbar is a horizontal navigation bar at the top of the page. Supports start, center, and end sections.

Basic Example

Navbar with brand and menu items



const { default: Navbar } = await import('/components/layout/navbar.js');
const { default: Button } = await import('/components/actions/button.js');
const { default: Menu } = await import('/components/navigation/menu.js');

const { tags, $ } = Lightview;

const navbar = Navbar({ class: 'bg-base-100 rounded-box' },
    Navbar.Start({},
        Button({ ghost: true, class: 'text-xl' }, '🚀 Lightview')
    ),
    Navbar.Center({ class: 'hidden lg:flex' },
        Menu({ horizontal: true },
            Menu.Item({}, Menu.Link({}, 'Features')),
            Menu.Item({}, Menu.Link({}, 'Pricing')),
            Menu.Item({}, Menu.Link({}, 'About'))
        )
    ),
    Navbar.End({},
        Button({ color: 'primary' }, 'Get Started')
    )
);

$('#demo').insert(navbar);

Sub-components

Component Description
Navbar.Start Left section (flex-1)
Navbar.Center Center section
Navbar.End Right section

With Dropdown

With Background Color

For more examples, see the DaisyUI Navbar documentation.