about summary refs log tree commit diff stats
path: root/internal/examples/app/html/home.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/examples/app/html/home.go')
-rw-r--r--internal/examples/app/html/home.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/examples/app/html/home.go b/internal/examples/app/html/home.go
new file mode 100644
index 0000000..d4e192c
--- /dev/null
+++ b/internal/examples/app/html/home.go
@@ -0,0 +1,20 @@
+package html
+
+import (
+	. "github.com/maragudk/gomponents"
+	. "github.com/maragudk/gomponents/html"
+)
+
+func HomePage(items []string) Node {
+	return page("Home",
+		H1(Text("Home")),
+
+		P(Text("This is a gomponents example app!")),
+
+		P(Raw(`Have a look at the <a href="https://github.com/maragudk/gomponents/tree/main/internal/examples/app">source code</a> to see how it’s structured.`)),
+
+		Ul(Group(Map(items, func(s string) Node {
+			return Li(Text(s))
+		}))),
+	)
+}