View source ↗

Comptime

A component without an allocator parameter is built by the compiler. Rendering it allocates nothing.

No props

Hello from the compiler.

Props

Props must be comptime-known; a runtime value is a compile error.

Hello, Ziex.

Hello, Zig!

comptime props

With comptime props, a prop can be a type.

  • x
  • y
  • label

Loops and .zon data

  1. Read the docs (done)
  2. Write a component
  3. Ship it

Inside runtime markup

This page runs per request for /examples/comptime; the line below is still static.

Hello from the compiler.

Pages, layouts and slots