Component as matrix
Each Component class works like a printing matrix: define the shape once and reuse it.
Mainz, 1450
This page is a guided introduction to the mainz framework. Each section introduces a concept and helps you progress with practical TSX examples.
Guided journey
Start by creating a class that extends Component and returns markup in render().
Code for this stage
import { Component } from "mainz";
// Foundation: create your root component
export class HomePage extends Component {
override render() {
return (
<main>
<h1>mainz</h1>
</main>
);
}
}Core concepts
Each Component class works like a printing matrix: define the shape once and reuse it.
Each setState applies a new print while the DOM receives incremental patching.
TSX handlers keep interactions straightforward while preserving lifecycle control.
Separating Hero, Cards, and Sandbox keeps the project scalable and maintainable.
Checkpoint
Before moving on, validate one key idea from the framework.
Question 1/3
Which method should initialize state before first render?
Back to topWorkshop
Complete challenges by writing code. A JavaScript validator checks your input and unlocks the next step.
Challenge 1/3
Create `import { Component } from "mainz"` and a class named `Todo` extending `Component`.