function createDropdown
createDropdown(options: CreateDropdownOptions): string

Create dropdown HTML string

Examples

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>' } ] });

Parameters

Dropdown configuration

Return Type

string

HTML string for the dropdown

Usage

import { createDropdown } from ".";