about summary refs log tree commit diff stats
path: root/internal/examples/app/html/home.go
diff options
context:
space:
mode:
authorMarkus Wüstenberg2024-09-19 21:45:31 +0200
committerGitHub2024-09-19 21:45:31 +0200
commit12acb8041060306b361109b46f9f05dbb4382ea0 (patch)
tree469f06f059809b6c606ff2e489896dec47a546a8 /internal/examples/app/html/home.go
parent69b0da41dff1813f3939cf4ea09fbbb2d06b7719 (diff)
downloadgomponents-12acb8041060306b361109b46f9f05dbb4382ea0.tar.lz
gomponents-12acb8041060306b361109b46f9f05dbb4382ea0.tar.zst
gomponents-12acb8041060306b361109b46f9f05dbb4382ea0.zip
Add full example app (#204)
Also, remove the other examples and simplify the readme.
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))
+		}))),
+	)
+}