aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/hello/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/components/hello/root.zig')
-rw-r--r--src/app/components/hello/root.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/app/components/hello/root.zig b/src/app/components/hello/root.zig
new file mode 100644
index 0000000..6f68550
--- /dev/null
+++ b/src/app/components/hello/root.zig
@@ -0,0 +1,17 @@
+const std = @import("std");
+const z = @import("z");
+
+pub const component: z.Component = .{
+ .name = "hello",
+ .html = .native(
+ .div,
+ .{ .onclick = "@clicked" },
+ .content("click me"),
+ ),
+ .css = @embedFile("index.css"),
+ .link = @This(),
+};
+
+pub fn clicked() void {
+ z.log.js.debug("hi");
+}