Library / SDK
fletcher-package/fletcher avatar
fletcher-package/fletcher

fletcher: commutative diagrams and flowcharts as Typst code, on top of CeTZ

Typst package for drawing diagrams with arrows, built on top of CeTZ.

1,144 stars37 forksTypstMIT

At a glance

What is it?
fletcher is a Typst package for drawing diagrams with arrows, layered on the CeTZ drawing library, with a change log that reads like a Typst package's own release notes. It covers commutative diagrams, flowcharts, state machines and Feynman diagrams, and the current version is 0.5.9, which added named edges.
Who is it for?
fletcher suits a Typst author who wants commutative diagrams, flowcharts or state machines in a document without leaving the Typst toolchain or exporting from an external drawing tool, and who is comfortable with a package that is versioned against Typst itself. It is the wrong choice if you need a diagram editor rather than source code, and a poor fit for a project pinned to an older Typst, because version 0.5.6 requires Typst 0.13.0 or newer.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Typst, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 24, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A Typst package for arrows, layered on CeTZ

fletcher is a Typst package for drawing diagrams with arrows, built on top of CeTZ, which is itself a Typst drawing library. The naming is a joke the project makes explicit in the README, defining fletcher as a noun meaning a maker of arrows. The relationship to CeTZ is the structural fact that matters, because fletcher is not a drawing engine. It is a diagram vocabulary on top of one: nodes, edges and the conventions that connect them. The package is published on Typst Universe, has its own documentation site, and points to a Typst forum thread and a Discord channel for help. The manual is a PDF in the docs directory rather than a wiki, which is a reasonable choice for a package whose reference material is largely a catalogue of options.

typ
#import "@preview/fletcher:0.5.9" as fletcher: diagram, node, edge

The diagram function is the whole entry point, with cells and coordinates

A diagram is built by calling diagram with a body of node and edge calls, and the README examples show the two ways the body is written. In the commutative diagram example, the body is a math mode block where nodes and edges are laid out with spacing commands and the content is set in math, so a label like tilde(f) or a hook arrow is typeset as mathematics. In the flowchart example, the body is plain Typst code with a sequence of node calls and edge calls, and each node carries a position, a content block and options such as corner-radius and extrude. The edge calls take a source, an optional label and an arrow tip specification, and the arrow tips are the verbose string syntax, so a line style is given as a string such as "->" or "-|>".

typ
#diagram(cell-size: 15mm, $
	G edge(f, ->) edge("d", pi, ->>) & im(f) \
	G slash ker(f) edge("ur", tilde(f), "hook-->")
$)

Node shapes and edge routing cover flowcharts, state machines and UML

The gallery in the README lists ten example files, and between them they define the scope of the package. There are commutative diagrams and an algebra cube, an ML architecture diagram, an IO flowchart, a digraph, node groups, a UML diagram, a tree, a Feynman diagram and a category theory diagram. The node shapes come from a shapes module, and the flowchart example imports a diamond shape from fletcher.shapes to draw a decision node. The state machine example uses a radial gradient fill, a fixed text size, spacing between nodes and edges that leave a node and return to it with a bend, which is what a loop transition looks like. The UML example shows a grouping construct, an enclose, with nodes nested inside it, and the node groups example shows the same idea with a label. Node options in the examples include extrude, which shifts a node and its content, and radius, which produces a circular node rather than a rectangular one.

typ
#import fletcher.shapes: diamond
#set text(font: "Comic Neue", weight: 600) // testing: omit

#diagram(
	node-stroke: 1pt,
	node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)),
	edge("-|>"),
	node((0,1), align(center)[
		Hey, wait,\ this flowchart\ is a trap!
	], shape: diamond),
	edge("d,r,u,l", "-|>", [Yes], label-pos: 0.1)
)

The Feynman example shows what a maths document needs and a flowchart does not

The Feynman diagram example is the shortest of the four in the README and it is the one that shows the package handling real typesetting. The body is a math mode block in which e to the minus and e to the plus are nodes, edges carry arrow tips such as the left-pointing and right-pointing forms, and a label is attached with the wave arrow, which is the notation for a photon. The nodes are separated with alignment and spacing commands so the resulting picture is a proper four-legged diagram rather than a box and arrow chart. The point of showing it is that the output is vector text in a Typst document, so the diagram is selectable, searchable, re-colours with the document and stays sharp at any zoom, and the labels are set in the same font as the surrounding mathematics rather than pasted in as a picture.

typ
#diagram($
	e^- edge("rd", "-<|-") & & & edge("ld", "-|>-") e^+ \
	& edge(gamma, "wave") \
	e^+ edge("ru", "-|>-") & & & edge("lu", "-<|-") e^- \
$)

The change log reads like a record of a package catching up with Typst

The change log is the most informative part of the repository for an adopter, because it shows the rate and direction of movement. Version 0.5.9 added support for named edges. Version 0.5.8 added bracket and parenthesis mark types with shorthands, added the cylinder, brace, bracket, paren and stretched-glyph node shapes, allowed label positions to be specified as a segment and position pair, and fixed bugs with the anchors of absolutely positioned enclose nodes along with some instabilities with edges related to division by zero. Version 0.5.7 was a dependency bump of CeTZ to 0.3.4 fixing bugs with Typst 0.13.1. Version 0.5.6 is the significant one: it requires Typst 0.13.0 or newer, updates CeTZ to 0.3.3, supports CeTZ anchors on nodes that dynamically enclose other nodes, allows nested enclosing of nodes, and adds a floating option to edge() so certain objects do not affect the diagram bounds, with debug annotations made floating for the same reason.

Anchors and enclosure: the feature that makes large diagrams tractable

Across the 0.5.x line the recurring theme is the relationship between nodes and the edges that touch them. Version 0.5.3 added support for CeTZ anchors in edge coordinates, so an edge can start and end at a named point on a node rather than at its centre, and 0.5.6 extends that to nodes which dynamically enclose other nodes, allowing nested enclosing of nodes. That combination is what makes a commutative diagram with a large enclosing box tractable, because the edges can be attached to the boundary of the enclosure instead of to a guessed coordinate. The 0.5.8 fix for the anchors of absolutely positioned enclose nodes is the sort of detail that only matters once you have built the diagram, and it is a reminder that the package is young and the edges are still being smoothed.

Version pinning, Typst Universe, and how the package is built

The import line pins the version explicitly, with the package identifier @preview/fletcher:0.5.9, and the version badge on the README reads 0.5.9 while a second badge tracks the development version from the typst.toml on the main branch. So there are two versions in play at any moment, the released one and the one on main, and a document that pins the preview version is reproducible. The repository layout shows a package project rather than a Typst document. There is a src/ directory, a tests/ directory, a scripts/ directory, docs/ containing the manual and the gallery with both the .typ sources and the rendered .svg files, a typst.toml for the package manifest, a package-excludes file, and both a pixi.toml with a pixi.lock and a scripts/ directory for the tooling. The README also has a README.src.md alongside the README, which is the pattern used when the README is generated from a source file.

Licence, upkeep and who maintains the arrows

The licence is MIT, with the LICENSE file at the repository root. The last push to the repository was on 2026-10-04, and the repository is not archived, and there are no GitHub releases, which is consistent with a package whose release channel is Typst Universe rather than GitHub. The badges in the README point at a repository under the Jollywatt account on GitHub while the package itself lives under the fletcher-package organisation, so the source repository and the published package are in different places, which is a small thing to know if you are trying to find the canonical checkout. The community is the Typst forum and a Discord channel, and the README says pull requests are most welcome. A package at version 0.5.9 with a change log this detailed is a project that is very much alive, and the 0.x version number is the honest signal that the API may still move.

Editorial conclusion

fletcher suits a Typst author who wants commutative diagrams, flowcharts or state machines in a document without leaving the Typst toolchain or exporting from an external drawing tool, and who is comfortable with a package that is versioned against Typst itself. It is the wrong choice if you need a diagram editor rather than source code, and a poor fit for a project pinned to an older Typst, because version 0.5.6 requires Typst 0.13.0 or newer. Before adopting it, read the manual PDF in the docs directory, pin the version rather than tracking main, and check the change log, since the 0.5.x line has repeatedly moved the minimum Typst version and the CeTZ dependency underneath you.

Frequently asked questions

What is the fletcher Typst package?

It is a Typst package for drawing diagrams with arrows, built on top of CeTZ. It covers commutative diagrams, flowcharts, state machines, UML diagrams, trees, digraphs and Feynman diagrams, and the current version is 0.5.9, which added support for named edges.

How do I import fletcher in a Typst document?

Use the import line #import "@preview/fletcher:0.5.9" as fletcher: diagram, node, edge, which pins the package version so the document stays reproducible. The package is published on Typst Universe, and a separate import of fletcher.shapes gives you the node shapes such as diamond.

Which Typst version does fletcher require?

Version 0.5.6 requires Typst 0.13.0 or newer, and version 0.5.7 updated the CeTZ dependency to 0.3.4 to fix bugs with Typst 0.13.1. So the minimum Typst version has moved with the package releases.

What node shapes and features does fletcher support?

Version 0.5.8 added the cylinder, brace, bracket, paren and stretched-glyph node shapes, and 0.5.6 allowed nested enclosing of nodes and CeTZ anchors on nodes that dynamically enclose other nodes. There is also a floating option on edge() so certain objects do not affect the diagram bounds.

Where is the fletcher documentation?

The manual is a PDF in the docs directory of the repository, and there is a gallery of ten examples with both the .typ sources and the rendered .svg files under docs/gallery. Help is available on the Typst forum and on a Discord channel.

Official sources

  1. fletcher-package/fletcher on GitHub
  2. Issues
  3. License: MIT
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/fletcher-package-fletcher.svg)](https://hysenlabs.com/projects/fletcher-package-fletcher)

Was this useful?