Type-checked Schema.org JSON-LD for React
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fix typo Jan 31, 2019
.gitignore Initial commit. Jan 31, 2019
CONTRIBUTING.md Initial commit. Jan 31, 2019
LICENSE Initial commit. Jan 31, 2019
README.md Improve README file Feb 5, 2019
package-lock.json Initial commit. Jan 31, 2019
package.json Also add Eyas as a "maintainer" in addition to author. Feb 6, 2019
tsconfig.json Initial commit. Jan 31, 2019

README.md

react-schemaorg npm version

react-schemaorg

Easily insert valid Schema.org JSON-LD using the custom <JsonLd> react component.

Uses schema-dts for Schema.org TypeScript definitions.

Note: This is not an officially supported Google product.

Usage

Install react-schemaorg and your desired version of schema-dts:

npm install schema-dts
npm install react-schemaorg

Then, to insert a simple JSON-LD snippet:

import { Person } from "schema-dts";
import { JsonLd } from "react-schemaorg";

export function GraceHopper() {
  return <JsonLd<Person>
    item={{
      "@context": "https://schema.org",
      "@type": "Person",
      name: "Grace Hopper",
      alternateName: "Grace Brewster Murray Hopper",
      alumniOf: {
        "@type": "CollegeOrUniversity",
        name: ["Yale University", "Vassar College"]
      },
      knowsAbout: ["Compilers", "Computer Science"]
    }}/>;
}

Developers

Use NPM to install dependencies:

npm install

Use tsc to build:

tsc

To contribute changes, see the CONTRIBUTING.md file.