SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

ReviewCard

One customer review.

Better in person

Heavy paper, rich colour, and the oak frame came without a scratch.

Maya R.2 weeks agoVerified buyer50×70 · Oak frame
Lovely print. Took a week longer than I hoped to arrive.
Tomás1 month ago30×40 · Unframed
View code
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Or copy it into your project to edit it:

Terminal
sdxc ui add review-card

Usage

typescript
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.

PropTypeRequiredDescription
authorRemixNodeYes
ratingnumberYesThe stars the reviewer gave, out of five.
titleRemixNodeNo
bodyRemixNodeYes
dateRemixNodeYesWhen it was written, such as a <time> or a relative date.
verifiedRemixNodeNoThe mark of a confirmed purchase, such as "Verified buyer"; shown with a check.
metaRemixNodeNoWhat the reviewer bought, such as "Size: 50×70 · Oak frame".
mediaRemixNodeNoPhotos the reviewer added, laid out by the caller.
helpfulRemixNodeNoA 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">.

@sdxc/ui

Can’t find it? Contact us