-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
38 lines (31 loc) · 1.1 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package gropdown
import "github.com/a-h/templ"
// Placement represents a position on the screen.
type Placement string
func (p Placement) String() string {
return string(p)
}
// DropdownItem represents an item in the dropdown menu.
type DropdownItem struct {
Label string // Label is the text displayed for the dropdown item.
Icon string // Icon is the icon displayed next to the dropdown item.
Href string // Href is the URL associated with the dropdown item.
External bool // External if the URL is an external URL.
Attrs templ.Attributes // Attrs is a map of attributes to be added to the element.
}
// ItemOptions represents all the options for the dropdown menu item.
type ItemOptions struct {
Icon string
Href string
External bool
Attrs templ.Attributes
}
// ButtonIcon represents the trigger button for the dropdown menu.
type ButtonIcon struct {
value string
size float32
}
// Icon constructs a ButtonIcon with the specified value and default size.
func Icon(v string) *ButtonIcon {
return &ButtonIcon{value: v, size: 1.25}
}