createDropdown(options: CreateDropdownOptions): string
Create dropdown HTML string
Example 1
Example 1
const html = createDropdown({ trigger: '<span>John Doe</span><i class="ph ph-caret-down"></i>', variant: 'header', align: 'right', items: [ { header: 'Account' }, { label: 'Profile', href: '/profile', icon: '<i class="ph ph-user"></i>' }, { label: 'Settings', href: '/settings', icon: '<i class="ph ph-gear"></i>' }, { divider: true }, { label: 'Logout', href: '/logout', variant: 'danger', icon: '<i class="ph ph-sign-out"></i>' } ] });
options: CreateDropdownOptions
Dropdown configuration