How to add caption to fletcher diagram?

In order to add a caption to anything in Typst you have to wrap in a figure(), see Figure - Typst Documentation. This works for images, tables and really any other type of content, including fletcher diagrams.

#let my-diagram = "something you made with fletcher"

#figure(
  my-diagram,
  caption: "This is the caption of my fletcher diagram"
)

I would also like to ask you to move your post to the Questions category and to change the title to an actual question you would ask a friend about Typst. See the following post about the Questions category if you want to know more: