Skip to content

jonasdev/jsx-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add Schema to your React application

Help Search Engines with structured data on your pages made with React. Read more about schema here https://schema.org/

How to use it

import JSXSchema from "jsx-schema";

export default function App() {
  return (
    <div className="App">
      <h1>Title of Product</h1>
      <JSXSchema
        type="Product"
        name="Name of product"
	sku="12345678"
	description="Lorem ipsum..."
	offers={{
	  type: "Offer",
	  price: 10,
	  priceCurrency: "USD",
	  availability: "In stock"
	}}
	aggregateRating={{
	  type: "AggregateRating",
	  ratingValue: "4.8",
	  reviewCount: "11"
	}}
      />
    </div>
  );
}

Context is using https://schema.org/ by default

If you wanna change it, simply add context as a prop. Validate schema here: https://validator.schema.org/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published