<x-dropdown> <x-button icon-trailing="o-chevron-down">Options</x-button> <x-menu> <x-menu.item icon="s-plus">New post</x-menu.item> <x-menu.submenu heading="Sub menu" icon="s-adjustments-horizontal"> <x-menu.item icon="s-plus">Action 1</x-menu.item> <x-menu.item>Action 2</x-menu.item> </x-menu.submenu> <x-menu.item variant="danger" icon="s-trash">Delete</x-menu.item> </x-menu></x-dropdown>
navmenu
component for a simple collections of links.
Otherwise, use the
menu
component for action menus that require keyboard navigation,
submenus, etc.
<x-dropdown position="bottom-end"> <x-profile avatar="https://ui-avatars.com/api/?name=Joe+Nikolaus&color=27272a&background=00000000&format=svg" name="Joe Nikolaus" /> <x-navmenu> <x-navmenu.item href="#" icon="s-user">Account</x-navmenu.item> <x-navmenu.item href="#" icon="s-building-storefront">Profile</x-navmenu.item> <x-navmenu.item href="#" icon="s-credit-card">Billing</x-navmenu.item> <x-navmenu.item href="#" icon="s-arrow-right-start-on-rectangle">Logout</x-navmenu.item> <x-navmenu.item href="#" icon="s-trash" variant="danger">Delete</x-navmenu.item> </x-navmenu></x-dropdown>
position
props, the default value is
bottom-start
.
top
,
top-start
,
top-end
.
bottom
,
bottom-start
,
bottom-end
.
left
,
left-start
,
left-end
.
right
,
right-start
,
right-end
.
offset
props. These properties accept values
in pixels, the default value is
6
.
<x-dropdown> <x-button icon-trailing="s-chevron-down">Options</x-button> <x-menu> <x-menu.item icon="s-pencil-square" kbd="Ctrl+S">Save</x-menu.item> <x-menu.item icon="s-document-duplicate" kbd="Ctrl+D">Duplicate</x-menu.item> <x-menu.item icon="s-trash" variant="danger">Delete</x-menu.item> </x-menu></x-dropdown>
<x-dropdown> <x-button icon-trailing="o-chevron-down">Options</x-button> <x-menu> <x-menu.item>View</x-menu.item> <x-menu.item>Transfer</x-menu.item> <x-menu.separator /> <x-menu.item>Publish</x-menu.item> <x-menu.item>Share</x-menu.item> <x-menu.separator /> <x-menu.item variant="danger">Delete</x-menu.item> </x-menu></x-dropdown>
<x-dropdown> <x-button icon-trailing="o-chevron-down">Options</x-button> <x-menu> <x-menu.group heading="Account"> <x-menu.item>Profile</x-menu.item> <x-menu.item>Permissions</x-menu.item> </x-menu.group> <x-menu.group heading="Billing"> <x-menu.item>Transactions</x-menu.item> <x-menu.item>Payouts</x-menu.item> <x-menu.item>Refunds</x-menu.item> </x-menu.group> <x-menu.item>Logout</x-menu.item> </x-menu></x-dropdown>