islands

look

An island is a component the app brings, inside a blocks screen. blocks gives it props and passes its named events back as actions. Until it loads, and with JS off, it shows the fallback the block carries, in the box it reserves.

Before it loads · x-later

An echo of its propsx-echo needs JS; until it loads, this row

Mounted · x-echo

An echo of its propsx-echo needs JS; until it loads, this row

Its contract

namethe custom element's tag: x-echo
props inset at mount and after each update: says
events outdispatched as blocks-event, sent as an action: echo
sizekept before it loads, so nothing jumps: 16:7

In Rust

Island::new("x-echo", fallback)
  .props(props)
  .events(vec!["echo".to_string()])
  .size(IslandSize { aspect: Some("16:7".into()), ..IslandSize::default() })
Every page here is a blocks Screen, written by site::page: no hand-written HTML. Source: https://github.com/jirathip-dev/blocks