# @davidcraig/react-schema

> A collection of commonly used json-ld schema helper functions for react apps.

Latest version **1.0.10** (published 2021-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @davidcraig/react-schema
pnpm add @davidcraig/react-schema
yarn add @davidcraig/react-schema
bun add @davidcraig/react-schema
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2021-02-16 |
| First published | 2021-02-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Craig |
| Maintainers | davidcraig |
| Keywords | json-ld |

## Links

- npm: https://www.npmjs.com/package/@davidcraig/react-schema
- npm.io page: https://npm.io/package/@davidcraig/react-schema

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.10 (latest) — 2021-02-16
- 1.0.9 — 2021-02-11
- 1.0.8 — 2021-02-11
- 1.0.7 — 2021-02-11
- 1.0.6 — 2021-02-11
- 1.0.5 — 2021-02-11
- 1.0.4 — 2021-02-07
- 1.0.3 — 2021-02-07
- 1.0.2 — 2021-02-07
- 1.0.1 — 2021-02-07
- 1.0.0 — 2021-02-07

## README

# 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

 - [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/) - Deprecated but still working for now.

---
_Source: https://npm.io/package/@davidcraig/react-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
