Structured Data

A component for embedding structured data (like JSON-LD) for SEO.

Installation

Import the component from the passport-ui package.

components/example.tsx
1import { StructuredData } from "passport-ui";

Usage

Basic example showing how to use the component.

components/example.tsx
1const articleData = {
2 "@context": "https://schema.org",
3 "@type": "Article",
4 headline: "Understanding React Component Libraries",
5 description: "A deep dive into building and maintaining React component libraries for modern web applications.",
6 author: {
7 "@type": "Person",
8 name: "Jordan Chen",
9 url: "https://example.com/authors/jordan-chen",
10 },
11 datePublished: "2024-01-15T09:00:00Z",
12 dateModified: "2024-01-20T16:45:00Z",
13 publisher: {
14 "@type": "Organization",
15 name: "Tech Insights",
16 logo: {
17 "@type": "ImageObject",
18 url: "https://placehold.co/300x100/059669/ffffff?text=Tech+Insights",
19 },
20 },
21 image: {
22 "@type": "ImageObject",
23 url: "https://placehold.co/800x400/0ea5e9/ffffff?text=React+Components",
24 width: 800,
25 height: 400,
26 },
27};
28
29<StructuredData data={articleData} />

Additional resources

Documentation and examples are available in Storybook.