All Projects → bentaylor2 → React Structured Data

bentaylor2 / React Structured Data

Licence: mit
React Structured Data provides an easy way to add structured data to your React apps

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Structured Data

schema-and-structured-data-for-wp
Creating the best Structured Data and Schema plugin for WordPress
Stars: ✭ 66 (-45%)
Mutual labels:  schema, seo, schema-org
Structured Data Json Ld
Collection of structured data snippets in Google preferred JSON-LD format.
Stars: ✭ 157 (+30.83%)
Mutual labels:  schema, json-ld, seo
React Border Wrapper
A wrapper for placing elements along div borders.
Stars: ✭ 147 (+22.5%)
Mutual labels:  react-components, react-component, jsx
Schema.net
Schema.org objects turned into strongly typed C# POCO classes for use in .NET. All classes can be serialized into JSON/JSON-LD and XML, typically used to represent structured data in the head section of html page.
Stars: ✭ 336 (+180%)
Mutual labels:  schema-org, schema, json-ld
seomate
SEO, mate! It's important. That's why SEOMate provides the tools you need to craft all the meta tags, sitemaps and JSON-LD microdata you need - in one highly configurable, open and friendly package - with a super-light footprint.
Stars: ✭ 31 (-74.17%)
Mutual labels:  seo, schema-org, json-ld
schema-dot-org
Validated structured data for websites
Stars: ✭ 42 (-65%)
Mutual labels:  seo, schema-org, json-ld
React Native demo
react-native实现网易新闻和美团,实现大部分页面。使用最新的react-navigation等组件,同时支持安卓和iOS设备。
Stars: ✭ 237 (+97.5%)
Mutual labels:  react-components, react-component, jsx
really-rich-results
RRR makes structured data for WordPress really rich, and really easy.
Stars: ✭ 21 (-82.5%)
Mutual labels:  schema, seo, schema-org
php-schema.org-mapping
A fluent interface to create mappings using Schema.org for Microdata and JSON-LD.
Stars: ✭ 31 (-74.17%)
Mutual labels:  schema, schema-org, json-ld
Schema Generator
PHP Model Scaffolding from Schema.org and other RDF vocabularies
Stars: ✭ 379 (+215.83%)
Mutual labels:  schema-org, schema, json-ld
React Workshop
⚒ 🚧 This is a workshop for learning how to build React Applications
Stars: ✭ 114 (-5%)
Mutual labels:  react-components, jsx
Schema Org
A fluent builder Schema.org types and ld+json generator
Stars: ✭ 894 (+645%)
Mutual labels:  schema, seo
Awesome React Components
Curated List of React Components & Libraries.
Stars: ✭ 28,626 (+23755%)
Mutual labels:  react-components, react-component
React Awesome Query Builder
User-friendly query builder for React
Stars: ✭ 682 (+468.33%)
Mutual labels:  react-components, react-component
Ultimate Metatags
A large snippet for your page's <head> that includes all the meta tags you'll need for OPTIMAL sharing and SEO. Extensive work has been put into ensuring you have the optimal images for the most important social media platforms.
Stars: ✭ 24 (-80%)
Mutual labels:  schema-org, schema
Base
React-UI-Kit - frontend library with ReactJS components
Stars: ✭ 18 (-85%)
Mutual labels:  react-components, react-component
Wp Structuring Markup
🔌 WordPress: Plug-in Markup (JSON-LD) structured in schema.org
Stars: ✭ 26 (-78.33%)
Mutual labels:  schema, json-ld
React Absolute Grid
An absolutely positioned, animated, filterable, sortable, drag and droppable, ES6 grid for React.
Stars: ✭ 910 (+658.33%)
Mutual labels:  react-components, react-component
Structured Data Testing Tool
A library and command line tool to help inspect and test for Structured Data.
Stars: ✭ 34 (-71.67%)
Mutual labels:  schema-org, json-ld
React Jsx Parser
A React component which can parse JSX and output rendered React Components.
Stars: ✭ 394 (+228.33%)
Mutual labels:  react-components, jsx

React Structured Data

React Structured Data provides an easy way to add structured data to your React apps. Structured data is a standardized format for providing information about a page and classifying the page content. This library follows guidelines specified at http://schema.org/.

Installation

Yarn

yarn add react-structured-data

NPM

npm install react-structured-data --save

Code Example

The following JSX:

  <JSONLD>
    <Product name="Product Name">
      <AggregateRating ratingValue={4.3} reviewCount={197}/>
      <GenericCollection type="review">
        <Review name="It's awesome" reviewBody="This is Great! My family loves it" datePublished="11/22/1963">
          <Author name="Jerry"/>
          <Location name="Chicago, IL"/>
          <Rating ratingValue={5} />
        </Review>
        <Review name="Very cool" reviewBody="I like this a lot. Very cool product" datePublished="11/22/1963">
          <Author name="Cool Carl"/>
          <Location name="Chicago, IL"/>
          <Rating ratingValue={4} />
        </Review>
      </GenericCollection>
    </Product>
  </JSONLD>

will add the following to your markup (will be minified):

<script type="application/ld+json">
  {
    "@context":"https://schema.org/",
    "@type":"Product",
    "name":"Product Name",
    "aggregateRating": {
      "@type":"AggregateRating",
      "ratingValue":4.3,
      "reviewCount":197
    },
    "review":[
      {
        "@type":"Review",
        "datePublished":"11/22/1963",
        "reviewBody":"This is Great! My family loves it",
        "name":"It's awesome",
        "author": {
          "@type":"Person",
          "name":"Jerry"
        },
        "locationCreated": {
          "@type":"AdministrativeArea",
          "name":"Chicago, IL"
        },
        "reviewRating": {
          "@type": "Rating",
          "ratingValue": 5
        }
      },
      {
        "@type":"Review",
        "datePublished":"11/22/1963",
        "reviewBody":"I like this a lot. Very cool product",
        "name":"Very cool",
        "author":{
          "@type":"Person",
          "name":"Cool Carl"
        },
        "locationCreated": {
          "@type":"AdministrativeArea",
          "name":"Chicago, IL"
        },
        "reviewRating": {
          "@type": "Rating",
          "ratingValue": 4
        }
      }
    ]
  }
</script>

Reference

PropTypes

Generic Component PropTypes

PropType Value Description
type String The @type description in the json-ld body: "@type": "Product"
jsonldtype String The value of the @type description in the json-ld body: "@type": "Product"
schema Object (json) This should be the schema that you want for your structured data node: {name: "It is awesome", reviewBody: "This is great!"}

JSONLD node propTypes

PropType Value Description
dangerouslyExposeHtml Boolean Set this to render the json within script tag using dangerouslySetInnerHTML

Schema node PropTypes

PropType Value Description
parentID String Sets the id of the schema that becomes a reference that the children point to "@id": "product-x"
id String similar to parentID but uses the ID on itself

Preset Components

There are several preset schema components that can be used

  • AggregateRating
  • Answer
  • Author
  • ItemReviewed
  • Location
  • Product
  • Question
  • Rating
  • Review

If you would like to use a component that is not listed, simply use the Generic component and add the prop jsonldtype. Generic and GenericCollection allow you to add your own structured data type.

For example, If Review preset didn't exist, you could write:

<JSONLD>
  <Generic type="review" jsonldtype="Review" schema={{name: "It is awesome", reviewBody: "This is great!"}}>
    <Generic type="itemReviewed" jsonldtype="Product" schema={{"@id":"product-x"}} />
    <Generic type="author" jsonldtype="Person" schema={{name: "Cool Carl"}}/>
    <Generic type="locationCreated" jsonldtype="AdministrativeArea" schema={{name: "Chicago, IL"}}/>
  </Generic>
</JSONLD>

This will output (minified):

<script type="application/ld+json">
  {
    "@context": "http://schema.org/",
    "@type": "Review",
    "name": "It is awesome",
    "reviewBody": "This is great!",
    "itemReviewed": {
      "@type": "Product",
      "@id": "product-x"
    },
    "author": {
      "@type": "Person",
      "name": "Cool Carl"
    },
    "locationCreated": {
      "@type": "AdministrativeArea",
      "name": "Chicago, IL"
    }
  }
</script>

This may seem not as ideal as using the presets, but this allows completely customizable structured data. There will also be more preset components to come in future releases to make implementation easier so stay tuned!

Structured Data and Schema.org

For more information on Structured data, visit https://developers.google.com/search/docs/guides/intro-structured-data, and also http://schema.org/. You can also validate the structured data here: https://search.google.com/structured-data/testing-tool.

Contributors

TBA

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].