Examples
Every example below is the exact code that ships in the playground — the docs and the editor can never drift apart. Click through for a walkthrough, or open one directly in the playground and start editing.
Hello, world
The smallest Lux program — one function, one print.
Walkthrough →
Reactive counter
A complete reactive app in ten lines: layout, state, events, and an energy readout.
Walkthrough →
Fibonacci
Recursion, an if-expression, and string interpolation — everything is an expression in Lux.
Walkthrough →
Pattern match + pipe
Exhaustiveness-checked match with ranges and guards, plus the pipe operator for left-to-right data flow.
Walkthrough →
HTTP server
A server with no framework — typed routes in the language itself. Each response carries X-Energy-Joules.
Walkthrough →