blocks
look
blocks
Typed screens, drawn the same on the web, in SwiftUI and as a static page.
35core kinds
3renderers: web, SwiftUI, static
13.7 KBof script, gzipped
0lines of hand-written HTML here
One shape for a screen
An app builds a Screen from typed blocks: rows, stats, forms, prose. A server sends it once, then only what changed. Each renderer draws the same tree, and every block carries a fallback, so a renderer that lacks a kind still shows something true.
With JS off, a page is plain HTML: every link works and every word reads. With blocks.js, the page is adopted where it stands, with no redraw.
This page, in Rust
Screen::new().id("home").title("blocks").blocks(vec![
Block::Nav(Box::new(nav)),
Block::Hero(Box::new(Hero::new("blocks")
.subtitle("Typed screens, drawn the same…")
.actions(acts))),
Block::Stat(Box::new(Stat::new().items(facts))),
])Look around
Galleryevery core kind, drawn from its sample; the ones with no HTML view show their fallback35 kindsStylesfour looks, and each part of a style drawn in the one you wear4 looksNumbersfirst paint, update cost and script size, against the budgets CI holdsBehavioursa form whose fields show, hide, check and enable in the page, with no serverIslandsan app's own component in a page, with its fallback beside it
Every page here is a blocks
Screen, written by site::page: no hand-written HTML. Source: https://github.com/jirathip-dev/blocks