From the forum announcement:
Elembic is a framework for custom elements and types in Typst. It implements this long-awaited feature in pure Typst, so you can use it for your packages and templates right now!
It lets you create:
-
Custom elements: Reusable and customizable document components, with support for typechecked fields, show and set rules (without state
by default, so it is reasonably performant!), reference and outline support, as well as features not yet in Typst such as revokable rules and child element selectors.
-
Custom types: Data structures with support for typechecked fields but also custom type casting. They can be used in element fields, but also for your own needs through e.types.cast(value, type)
.
See also:
elembic on Typst Universe