Ship faster with goilerplate templUI Pro

Dropdown

Floating menu for displaying a list of actions or options. Uses Popover for the popup.

Source Tailwind CSS JavaScript

Installation

  1. Install the component

    templui add dropdown
  2. Add 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

Required parameter
Hover for description

Trigger

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil

Content

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil
Placement
dropdown.Placement
PlacementBottomStart

Group

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil

Label

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil

Item

Name Type Default
ID
string
randomID
Class
string
""
Attributes
templ.Attributes
nil
Disabled
bool
false
Href
string
""
Target
string
""
PreventClose
bool
false

Separator

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil

Shortcut

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil

Sub

Name Type Default
ID
string
randomID
Class
string
""
Attributes
templ.Attributes
nil

SubTrigger

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil

SubContent

Name Type Default
ID
string
""
Class
string
""
Attributes
templ.Attributes
nil