nuxt-x-schema
Review
Schema.org Review and AggregateRating JSON-LD component for product and service reviews.
Review
The XSchemaReview component injects a <script type="application/ld+json"> tag for review or aggregate rating structured data. No visible output — SEO only.
Components
<XSchemaReview />
Use on product, service, or business pages. Toggle between a single Review and an AggregateRating via the isAggregate prop.
<XSchemaReview
:item-reviewed="{ '@type': 'Product', name: 'Headphones' }"
:review-rating="{ ratingValue: 5, bestRating: 5 }"
author="Jane Doe"
review-body="Excellent sound quality!"
/>
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
itemReviewed | Record<string, any> | Yes | — | The item being reviewed (include @type and name) |
reviewRating | Rating | Yes | — | Rating object { ratingValue, bestRating? } |
author | String | Person | Yes | — | Reviewer name or Person object |
reviewBody | String | No | — | Full review text |
datePublished | String | No | — | ISO 8601 review date |
isAggregate | boolean | No | false | When true, outputs AggregateRating schema instead of individual Review |
ratingCount | Number | No | — | Total rating count (aggregate mode) |
reviewCount | Number | No | — | Total review count (aggregate mode) |
AI Context
component: XSchemaReview
package: "@xenterprises/nuxt-x-schema"
output: JSON-LD script tag in <head>
use-when: Adding Review or AggregateRating structured data on product, service, or business pages
place: In page-level components (pages/ or layouts/), NOT in shared headers
notes:
- Renderless component — no visible DOM output; purely SEO metadata
- Injects JSON-LD server-side via useHead — SSR-safe, visible to crawlers on first paint
- isAggregate=true switches output from Review to AggregateRating schema
- itemReviewed must include @type and name
