ziex/test/data/style/basic.zig

21 lines
542 B
Zig

pub fn Page(allocator: zx.Allocator) zx.Component {
const style: zx.Style = .{
.display = .flex,
.background_color = .hex(0xff0000),
};
var _zx = @import("zx").x.allocInit(allocator, .{ .src = @src() });
return _zx.ele(
.div,
.{
.allocator = allocator,
.attributes = _zx.attrs(.{
_zx.attr(@src(), "style", style),
}),
.children = &.{
_zx.txt("Hello"),
},
},
);
}
const zx = @import("zx");