Open this example in the interactive library
Source code
"use client";
// components/ContrastPresetReader.tsx
import { Suspense } from "react";
import { useSearchParams } from "next/navigation";
function ContrastPresetReaderContent() {
const preset = useSearchParams().get("paper");
const dark = preset === "ink";
return (
<article
style={{
padding: 20,
color: dark ? "#faf5ef" : "#24221e",
background: dark ? "#14120f" : "#faf5ef",
}}
>
Reading surface preview
</article>
);
}
export default function ContrastPresetReader() {
return (
<Suspense fallback={<span>Loading view…</span>}>
<ContrastPresetReaderContent />
</Suspense>
);
}
