Looking for template / snippets to design surveys

Hi, welcome!

You can implement this with table or grid. There’s a tutorial in Tables – Typst Documentation.

#set page(height: auto, width: 240pt, margin: 1em)

#let options = ([Excellent], [Good], [Okay])
#let questions = (
  [Did you find food up to the mark?],
  [How was...],
  [Was waitering...],
  [Was the ambience...],
)

#table(
  columns: (6em,) + (1fr,) * options.len(),
  stroke: none,
  fill: (x, y) => if y > 0 { luma(96%) },
  align: (x, y) => if x == 0 { horizon + left } else { horizon + center },
  row-gutter: 0.5em,

  table.header([], ..options),
  
  ..questions
    .map(q => (
      (q,) + (circle(radius: 0.4em, stroke: luma(30%)),) * options.len()
    ))
    .flatten()
)

I can provide further explanation if you need.

3 Likes