Education
Parent Communication Card - Family Engagement
Track parent-school communications and engagement. Monitor message delivery and parent involvement metrics.
Parent Communication Card
The Parent Communication Card displays unread messages from parents and provides quick access to the communication inbox.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/parent-comm-card.jsonParent Communication Card
'use client'import React from 'react';import { MessageSquare } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, BarChart, Bar, Tooltip, XAxis, Cell } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface CommData { day: string; count: number; color: string; [key: string]: any;}interface ParentCommCardProps { className?: string; title?: string; subtitle?: string; data?: CommData[];}const DEFAULT_DATA: CommData[] = [ { day: 'Mon', count: 2, color: '#3b82f6' }, { day: 'Tue', count: 5, color: '#3b82f6' }, { day: 'Wed', count: 3, color: '#3b82f6' }, { day: 'Thu', count: 8, color: '#3b82f6' }, { day: 'Fri', count: 4, color: '#3b82f6' },];const DEFAULT_TITLE = "Parents";const DEFAULT_SUBTITLE = "Communications";export const ParentCommCard: React.FC<ParentCommCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, 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"> <MessageSquare className="h-5 w-5" /> </div> </div> <div className="flex-1 w-full min-h-[100px]"> <ResponsiveContainer width="100%" height="100%"> <BarChart data={data}> <XAxis dataKey="day" axisLine={false} tickLine={false} tick={{ fontSize: 10, fill: '#71717a' }} /> <Tooltip cursor={false} content={() => null} /> <Bar dataKey="count" radius={[4, 4, 0, 0]}> {data.map((entry, index) => ( <Cell key={`cell-${index}`} fill={entry.color} /> ))} </Bar> </BarChart> </ResponsiveContainer> </div> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none"> <MessageSquare className="w-32 h-32 text-blue-500" /> </div> </motion.div > );};Usage
This component helps teachers manage parent communications, ensuring important messages are not missed.
Prop
Type