Dropdown
Context menus and option pickers. Click outside to close.
Component
@dropdown.Dropdown(dropdown.Props{}) {
@dropdown.Trigger() {
@button.Button(button.Props{Variant: button.VariantOutline}) {
Options
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.22 8.22a.75.75 0 011.06 0L10 11.94l3.72-3.72a.75.75 0 111.06 1.06l-4.25 4.25a.75.75 0 01-1.06 0L5.22 9.28a.75.75 0 010-1.06z"/>
</svg>
}
}
@dropdown.Menu(dropdown.Props{Align: dropdown.AlignStart}) {
@dropdown.Label("Actions")
@dropdown.Item(dropdown.ItemProps{Label: "Edit", Href: "#"})
@dropdown.Item(dropdown.ItemProps{Label: "Duplicate", Href: "#"})
@dropdown.Separator()
@dropdown.Item(dropdown.ItemProps{Label: "Delete", Danger: true})
}
}