@davidcraig/react-schema

1.0.10 • Public • Published

React Schema.org

Set of helper classes to generate json-ld for a react application. Recommended to be used in SSR rendered websites or where treeshaking will remove unused code.

Example Usage

Simple object:

import { WebSite } from '@davidcraig/react-schema'
...

<WebSite
  name='My Website'
  description='Personal website for Me'
/>

With nested properties (using json) (not recommended):

import { WebSite } from '@davidcraig/react-schema
...

<WebSite
  name='Your Name'
  description='Personal website for Your Name'
  about={{
    type: 'Person', name: 'Your Name', url: 'https://dcraig.dev'
  }}
/>

With generated json from nested modules:

| Note: Each module exports their Json builder function.

import { WebSite } from '@davidcraig/react-schema
import { PersonJson } from '@davidcraig/react-schema/dist/Person/Person'
...

<WebSite
  name='Your Name'
  description='Personal website for Your Name'
  about={
    PersonJson({
      name: 'Your Name'
    })
  }
/>

Resources

Readme

Keywords

Package Sidebar

Install

npm i @davidcraig/react-schema

Weekly Downloads

1

Version

1.0.10

License

ISC

Unpacked Size

22.1 kB

Total Files

17

Last publish

Collaborators

  • davidcraig