mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-22 11:39:34 -06:00
29 lines
691 B
Zig
29 lines
691 B
Zig
pub fn Page(allocator: zx.Allocator) zx.Component {
|
|
var _zx = zx.initWithAllocator(allocator);
|
|
return _zx.zx(
|
|
.main,
|
|
.{
|
|
.allocator = allocator,
|
|
.children = &.{
|
|
_zx.lazy(Button, .{ .title = "Custom Button" }),
|
|
},
|
|
},
|
|
);
|
|
}
|
|
|
|
const ButtonProps = struct { title: []const u8 };
|
|
pub fn Button(allocator: zx.Allocator, props: ButtonProps) zx.Component {
|
|
var _zx = zx.initWithAllocator(allocator);
|
|
return _zx.zx(
|
|
.button,
|
|
.{
|
|
.allocator = allocator,
|
|
.children = &.{
|
|
_zx.txt(props.title),
|
|
},
|
|
},
|
|
);
|
|
}
|
|
|
|
const zx = @import("zx");
|