Education
Peer Review Card - Collaborative Learning
Track peer review submissions and assessment completion. Monitor student feedback and collaborative learning activities.
Peer Review Card
The Peer Review Card displays average peer review ratings for group projects with feedback quotes.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/peer-review-card.jsonPeer Review Card
'use client'import React from 'react';import { ThumbsUp } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, RadialBarChart, RadialBar, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface ReviewData { name: string; value: number; fill: string; [key: string]: any;}interface PeerReviewCardProps { className?: string; title?: string; subtitle?: string; ratingValue?: number; maxRating?: number; comment?: string; data?: ReviewData[];}const DEFAULT_DATA: ReviewData[] = [ { name: 'Rating', value: 4.5, fill: '#3b82f6' },];const DEFAULT_TITLE = "Peer Reviews";const DEFAULT_SUBTITLE = "Group Projects";const DEFAULT_RATING_VALUE = 4.5;const DEFAULT_MAX_RATING = 5.0;const DEFAULT_COMMENT = "\"Great team player!\"";export const PeerReviewCard: React.FC<PeerReviewCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, ratingValue = DEFAULT_RATING_VALUE, maxRating = DEFAULT_MAX_RATING, comment = DEFAULT_COMMENT, data = DEFAULT_DATA,}) => { return ( <motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5, delay: 0.1 }} className={cn( "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all hover:border-primary/50 hover:shadow-md flex flex-col h-full", className )} > <div className="p-5 flex flex-col h-full relative z-10"> <div className="mb-4 flex items-start justify-between"> <div> <h3 className="font-bold text-lg text-foreground"> {title} </h3> <p className="text-sm text-muted-foreground font-medium"> {subtitle} </p> </div> <div className="rounded-xl bg-blue-500/10 p-2.5 text-blue-500 dark:text-blue-400 flex items-center justify-center ring-1 ring-blue-100 dark:ring-blue-800"> <ThumbsUp className="h-5 w-5" /> </div> </div> <div className="flex-1 w-full min-h-[120px] relative"> <ResponsiveContainer width="100%" height="100%"> <RadialBarChart cx="50%" cy="50%" innerRadius="70%" outerRadius="100%" barSize={10} data={data} startAngle={180} endAngle={0} > <RadialBar background dataKey="value" cornerRadius={10} /> <Tooltip cursor={false} content={() => null} /> </RadialBarChart> </ResponsiveContainer> <div className="absolute inset-0 flex items-center justify-center pointer-events-none pt-4"> <div className="text-center"> <span className="text-2xl font-bold text-foreground">{ratingValue}</span> <p className="text-[10px] text-muted-foreground uppercase tracking-wider">/ {maxRating.toFixed(1)}</p> </div> </div> </div> <div className="text-center text-xs text-muted-foreground italic">{comment}</div> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none"> <ThumbsUp className="w-32 h-32 text-blue-500" /> </div> </motion.div > );};Usage
This component helps students and teachers track peer review feedback for collaborative projects and group work.
Prop
Type