(defcomp
  ()
  (div
    (~tw :tokens "space-y-3")
    (div
      (~tw :tokens "flex gap-2 items-center")
      (button
        :sx-get "/sx/(geography.(hypermedia.(reference.(api.time))))"
        :sx-target "#ref-preserve-container"
        :sx-swap "innerHTML"
        (~tw :tokens "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm")
        "Swap container")
      (span
        (~tw :tokens "text-xs text-stone-400")
        "The input below keeps its value across swaps."))
    (div
      :id "ref-preserve-container"
      (~tw :tokens "space-y-2")
      (input
        :id "ref-preserved-input"
        :sx-preserve "true"
        :type "text"
        :placeholder "Type here — preserved across swaps"
        (~tw :tokens "w-full px-3 py-2 border border-stone-300 rounded text-sm"))
      (div
        (~tw :tokens "p-2 bg-stone-100 rounded text-sm text-stone-600")
        "This text will be replaced on swap."))))
