React Schemaorg

Type-checked Schema.org JSON-LD for React
Alternatives To React Schemaorg
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
30 Days Of Javascript38,544
2 days ago1January 19, 2022326JavaScript
30 days of JavaScript programming challenge is a step-by-step guide to learn JavaScript programming language in 30 days. This challenge may take more than 100 days, please just follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
Sheetjs33,5844,3793,8162 months ago170March 24, 2022129apache-2.0JavaScript
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs
Jsoncrack.com25,657
a day ago41gpl-3.0TypeScript
✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML, CSV and more, into interactive graphs.
Normalizr20,9873,3886332 years ago43March 19, 202222mitJavaScript
Normalizes nested JSON according to a schema
React Jsonschema Form13,047566299a day ago103December 16, 2019272apache-2.0TypeScript
A React component for building Web forms from JSON Schema.
Jsonhero Web8,074
a day ago58apache-2.0TypeScript
JSON Hero is an open-source, beautiful JSON explorer for the web that lets you browse, search and navigate your JSON files at speed. 🚀. Built with 💜 by the Trigger.dev team.
Api Platform8,044
2 days ago37February 12, 2018579mitTypeScript
Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Tabulator5,69031717 days ago85July 23, 2023131mitJavaScript
Interactive Tables and Data Grids for JavaScript
Survey Library3,73437199 hours ago436August 08, 2023541mitTypeScript
Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
React Docgen3,4548,2301,74411 hours ago87August 14, 202379mitTypeScript
A CLI and library to extract information from React component files for documentation generation purposes.
Alternatives To React Schemaorg
Select To Compare


Alternative Project Comparisons
Readme

react-schemaorg npm version Node.js CI Coverage Status

react-schemaorg

Easily insert valid Schema.org JSON-LD in your React apps.

This library provides <JsonLd> for plain React apps, and helmetJsonLdProp() for use with <Helmet>.

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

Plain React Usage

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"],
      }}
    />
  );
}

Directly creating <script> tags (for next/head and elsewhere)

Certain <head> management libraries require <script> tags to be directly included, rather than wrapped in a component. This includes NextJS's next/head, and react-helmet. With these, we can use the jsonLdScriptProps export to do the same thing:

import { Person } from "schema-dts";
import { jsonLdScriptProps } from "react-schemaorg";
import Head from "next/head";

export default function MyPage() {
  return (
    <Head>
      <script
        {...jsonLdScriptProps<Person>({
          "@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"],
        })}
      />
    </Head>
  );
}

React Helmet Usage

To set JSON-LD in React Helmet, you need to pass it to the script={[...]} prop array in the Helmet component:

import { Person } from "schema-dts";
import { helmetJsonLdProp } from "react-schemaorg";
import { Helmet } from "react-helmet";

<Helmet
  script={[
    helmetJsonLdProp<Person>({
      "@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.

Popular Reactjs Projects
Popular Json Projects
Popular Web User Interface Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Typescript
Reactjs
Json
Semantic Web
Helmet
Json Ld
Schema Org