(defcomp
  ()
  (~docs/page
    :title "Refs — Imperative DOM Access"
    (p
      "The "
      (code ":ref")
      " attribute captures a DOM element handle into a dict. Use it for imperative operations: focusing, measuring, reading values.")
    (~reactive-islands/index/demo-refs)
    (~docs/code
      :src (highlight
        (component-source "~reactive-islands/index/demo-refs")
        "lisp"))
    (p
      "React equivalent: "
      (code "useRef")
      ". In SX, a ref is just "
      (code "(dict \"current\" nil)")
      " — no special API. The "
      (code ":ref")
      " attribute sets "
      (code "(dict-set! ref \"current\" el)")
      " when the element is created. Read it with "
      (code "(get ref \"current\")")
      ".")))
