ReviewCard
One customer review.
Better in person
Heavy paper, rich colour, and the oak frame came without a scratch.
Lovely print. Took a week longer than I hoped to arrive.
View code
<ReviewCard
author="Maya R."
rating={5}
title="Better in person"
body={<p>Heavy paper, rich colour, and the oak frame came without a scratch.</p>}
date="2 weeks ago"
verified="Verified buyer"
meta="50×70 · Oak frame"
helpful={
<form method="post" action="/reviews/81/helpful">
<button type="submit">Helpful (12)</button>
</form>
}
/>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Or copy it into your project to edit it:
sdxc ui add review-cardUsage
import { ReviewCard } from "@sdxc/ui";Renders the review as an <article>: small stars and the title on top, the body in reading
size, photos beneath, and a wrapping footer row of author, date, verified mark and purchase
with the helpful slot pushed to the end.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
author | RemixNode | Yes | |
rating | number | Yes | The stars the reviewer gave, out of five. |
title | RemixNode | No | |
body | RemixNode | Yes | |
date | RemixNode | Yes | When it was written, such as a <time> or a relative date. |
verified | RemixNode | No | The mark of a confirmed purchase, such as "Verified buyer"; shown with a check. |
meta | RemixNode | No | What the reviewer bought, such as "Size: 50×70 · Oak frame". |
media | RemixNode | No | Photos the reviewer added, laid out by the caller. |
helpful | RemixNode | No | A slot at the end of the footer, such as a POST form voting the review helpful. |
Also accepts everything in Omit<TagProps<"article">, "children" | "title">.