Blockst: Create visual block-based code (Scratch!-style)

Hi everyone!

A while ago, I started a thread here asking: “How would you build block-based programming visuals in Typst/CeTZ?”.

After some experimentation and driven by my needs as a computer science teacher, I decided to take matters into my own hands. I’m excited to show you the result: blockst is now available on Universe!

It’s a package for rendering visual code blocks (Scratch style) natively in Typst. It’s still in its early stages and certainly not “pixel-perfect” yet, but it’s already fully functional and has been a lifesaver for creating my teaching materials.

What’s inside:

  • Classic Block Shapes: Support for Hat, Stack, Reporter, Predicate, and Cap blocks.
  • Nesting & Inputs: Easily nest blocks and define various input types.
  • Styling: Flexible color and shape configurations to match different environments.

Looking for Feedback & Contributors

Since I built this primarily for my own classroom use, I’d love to get the community’s perspective to make it more versatile:

  1. Visual Polish: What are the most important visual tweaks needed to make it look “right”?
  2. Language Support: I’ve focused on Scratch-like aesthetics. Which other block languages (Snap!, MakeCode, etc.) should I include as presets?
  3. Future Direction: What features would make this a “must-have” for CS educators or technical writers?

Check it out here: blockst – Typst Universe

Thanks to everyone who gave me initial ideas in the original thread. I’m looking forward to seeing what you think!

16 Likes