-
Notifications
You must be signed in to change notification settings - Fork 0
/
detachedtoggle.go
55 lines (52 loc) · 1.32 KB
/
detachedtoggle.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package expandablesection
import app "github.com/maxence-charriere/go-app/v9/pkg/app"
type DetachedToggle struct {
app.Compo
}
func (c *DetachedToggle) Render() app.UI {
return app.Div().
Class("pf-l-stack pf-m-gutter").
Body(
app.Div().
Class("pf-l-stack__item").
Body(
app.Div().
Class("pf-c-expandable-section pf-m-expanded pf-m-detached").
Body(
app.Div().
Class("pf-c-expandable-section__content").
ID("detached-toggle-content").
Body(
app.Text("This content is visible only when the component is expanded."),
),
),
),
app.Div().
Class("pf-l-stack__item").
Body(
app.Div().
Class("pf-c-expandable-section pf-m-expanded pf-m-detached").
Body(
app.Button().
Type("button").
Class("pf-c-expandable-section__toggle").
Aria("expanded", true).
Aria("controls", "detached-toggle-content").
Body(
app.Span().
Class("pf-c-expandable-section__toggle-icon pf-m-expand-top").
Body(
app.I().
Class("fas fa-angle-right").
Aria("hidden", true),
),
app.Span().
Class("pf-c-expandable-section__toggle-text").
Body(
app.Text("Show less"),
),
),
),
),
)
}