Component docs
Loading
import { JsonLd } from "@pixxl-tools/components";
// In Server Components:
import { JsonLd } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
data (required) | JsonLdData | — | One schema.org object or a list (rendered as a JSON array). |
id | string | — | Id of the script element. |
nonce | string | — | CSP nonce. JSON-LD is data, not script, so most policies do not need it. |
datarequiredJsonLdData
One schema.org object or a list (rendered as a JSON array).
idstring
Id of the script element.
noncestring
CSP nonce. JSON-LD is data, not script, so most policies do not need it.
The structured data is in a script element: nothing to see here.
import { JsonLd } from "@pixxl-tools/components/server";
<JsonLd
data={[
{ "@context": "https://schema.org", "@type": "WebSite", name: "Example", url: "https://example.com" },
{ "@context": "https://schema.org", "@type": "Organization", name: "Example", url: "https://example.com" },
]}
/>