Embedding a Grid in a CeTZ box

How do I embed a grid inside a CeTZ box?

This is a code block that works fine.

#import "@preview/cetz:0.3.2"

#let colorScheme = (
  fg: black,
  bg: white,
)

#set page(width: auto, height: auto, margin: 1cm, fill: colorScheme.bg)
#set text(fill: colorScheme.fg, size: 14pt, font: "Roboto Mono")

#cetz.canvas({
  import cetz.draw: *
  import cetz.decorations: brace

  let w = 11     
  let h = 8         
  let r = 0.5       

  let cell-y = 0
  content((0, cell-y + h/2), name: "cell", box(
    width: w * 1cm, 
    height: h * 1cm, 
    radius: r * 1cm, 
    clip: true,
    stroke: (paint: colorScheme.fg, thickness: 1.5pt),
  )[
    
  ]
)
})

This is another code block that works fine (on its own)

#grid(
  columns: 5,
  gutter: 5pt,
  ..range(25).map(str)
)

However, I cannot if I write

content((0, cell-y + h/2), name: "cell", box(
    width: w * 1cm, 
    height: h * 1cm, 
    radius: r * 1cm, 
    clip: true,
    stroke: (paint: colorScheme.fg, thickness: 1.5pt),
  )[
    #grid(
  columns: 5,
  gutter: 5pt,
  ..range(25).map(str)
)
  ]
)

that wouldn’t work. Am I doing something wrong?

The line import cetz.draw: * imports cetz.draw.grid, meaning #grid defaults to the cetz grid instead of the standard typst grid. To fix your error, you can replace #grid(...) with #std.grid(...).

Also, be sure to use the correct category tag (this should be in Questions) and to read How to post in the Questions category