Dropdown
Floating menu for displaying a list of actions or options. Uses Popover for the popup.
Installation
Install the component
templui add dropdownAdd the JavaScript to your layout
@dropdown.Script() @popover.Script()Call this template in your base layout file (e.g., in the <head> section).
API Reference
Dropdown
| Name | Type | Default |
|---|---|---|
Unique identifier for the dropdown (used internally for context) | | |
Trigger
| Name | Type | Default |
|---|---|---|
Unique identifier for the trigger element | | |
Additional CSS classes to apply to the trigger | | |
Additional HTML attributes to apply to the trigger | | |
Content
| Name | Type | Default |
|---|---|---|
Unique identifier for the content element | | |
Additional CSS classes to apply to the content | | |
Additional HTML attributes to apply to the content | | |
Position of the dropdown relative to trigger (e.g., PlacementBottomEnd, PlacementTopStart) | | |
Group
| Name | Type | Default |
|---|---|---|
Unique identifier for the group element | | |
Additional CSS classes to apply to the group | | |
Additional HTML attributes to apply to the group | | |
Label
| Name | Type | Default |
|---|---|---|
Unique identifier for the label element | | |
Additional CSS classes to apply to the label | | |
Additional HTML attributes to apply to the label | | |
Item
| Name | Type | Default |
|---|---|---|
Unique identifier for the item element | | |
Additional CSS classes to apply to the item | | |
Additional HTML attributes to apply to the item | | |
Whether the item is disabled | | |
URL to navigate to when item is clicked (renders as anchor) | | |
Target attribute for anchor items | | |
Whether to prevent dropdown from closing when item is clicked | | |
Separator
| Name | Type | Default |
|---|---|---|
Unique identifier for the separator element | | |
Additional CSS classes to apply to the separator | | |
Additional HTML attributes to apply to the separator | | |
Shortcut
| Name | Type | Default |
|---|---|---|
Unique identifier for the shortcut element | | |
Additional CSS classes to apply to the shortcut | | |
Additional HTML attributes to apply to the shortcut | | |
Sub
| Name | Type | Default |
|---|---|---|
Unique identifier for the submenu container | | |
Additional CSS classes to apply to the submenu container | | |
Additional HTML attributes to apply to the submenu container | | |
SubTrigger
| Name | Type | Default |
|---|---|---|
Unique identifier for the submenu trigger | | |
Additional CSS classes to apply to the submenu trigger | | |
Additional HTML attributes to apply to the submenu trigger | | |
SubContent
| Name | Type | Default |
|---|---|---|
Unique identifier for the submenu content | | |
Additional CSS classes to apply to the submenu content | | |
Additional HTML attributes to apply to the submenu content | | |