The Menu component provides a simple and lightweight solution for creating beautiful menus your Laravel application.
The button component requires no additional imports.
To use the button component, follow these steps.
<x-ui::menu>
<x-ui::menu-title>
My Menu
</x-ui::menu-title>
<x-ui::menu-link href="/cool" :respect-sub-navigation="false">
Cool link
</x-ui::menu-link>
<x-ui::menu-divider/>
</x-ui::menu>
The Menu is the parent, you need. It renders a <ul/> element to display the menu. It has no attributes.
The title renders a styled title. It has a slot to set the content of the title.
<x-ui::menu-title>
Settings
</x-ui::menu-title>
Renders a simple divider for the menu.
<x-ui::menu-divider/>
The link renders a link. It has a slot to set the content of the link.
<x-ui::menu-link href="/settings"
:respect-sub-navigation="false">
Settings
</x-ui::menu-link>
The link has a slot for a extra, this is a item, which is shown at the end of the link (intended for a badge or button)
<x-ui::menu-link href="/settings"
:respect-sub-navigation="false">
Settings
<x-slot name="extra">
6
</x-slot>
</x-ui::menu-link>
| Name | Type | Purpose | Default value | Example value |
|---|---|---|---|---|
| $href | string, required | Set the href of the link and when the link should be highlighted | - | /settings |
| $respectSubNavigation | boolean | If /settings should be highlighted when visiting /settings/account |
false | true |
How can I help you explore Laravel packages today?