This UI component hasn't been finalized yet. The functionality and syntax aren't stable and might be redone in an upcoming release. Only use it at your own risk - breaking changes are likely to occur.
Dropdowns are constructed with two elements:
<k-dropdown> is used as wrapper to position the dropdown relatively to the button (or any other element) that serves as toggle.
<k-dropdown-content> holds any content shown when opening the dropdown: any number of
<k-dropdown-item> elements or any other HTML.
Instead of adding
k-dropdown-item elements manually, you can also inject them with an array
Using a Panel dropdown extension, you can simply reference it like this:
The item array can also be returned in an options handler to dynamically load options
Dropdown items can also be fetched from a JSON endpoint:
This will fetch the options only as soon as the dropdown will be opened.