News Card
poyraz/news-cardFreeBlock
Poyraz Soft Glass news-card with semantic states and composable variants.
Install it
npx shadcn@latest add https://ui.poyrazavsever.com/r/news-card.jsonSource
1import * as React from "react";2import { Badge } from "@/components/ui/atoms/badge";3import { Card, type CardProps } from "@/components/ui/atoms/card";4import { cn } from "@/lib/utils";56export interface NewsCardProps extends Omit<CardProps, "title"> {7 image?: string;8 category?: string;9 title: string;10 date?: string;11 href?: string;12}13const NewsCard = React.forwardRef<HTMLDivElement, NewsCardProps>(14 ({ category, className, date, href, image, title, ...props }, ref) => {15 const content = (16 <Card17 ref={ref}18 variant="interactive"19 className={cn("group h-fit self-start overflow-hidden", className)}20 {...props}21 >22 <div className="flex min-h-28">23 {image && (24 <div className="w-28 shrink-0 overflow-hidden border-r border-border">25 <img26 src={image}27 alt=""28 className="size-full object-cover transition-transform duration-300 group-hover:scale-105"29 />30 </div>31 )}32 <div className="flex min-w-0 flex-col justify-center gap-2 p-4">33 {category && (34 <Badge size="sm" variant="outline">35 {category}36 </Badge>37 )}38 <h3 className="line-clamp-2 text-sm font-semibold leading-snug">{title}</h3>39 {date && <span className="text-xs text-muted-foreground">{date}</span>}40 </div>41 </div>42 </Card>43 );44 return href ? (45 <a href={href} className="block text-inherit no-underline">46 {content}47 </a>48 ) : (49 content50 );51 },52);53NewsCard.displayName = "NewsCard";54export { NewsCard };
What it pulls in
Other registry items
Files it writes
More from poyraz
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Article Cardarticle-card | poyraz | Blocks | Free | no deps | |
| Auth Card Blockauth-card-block | poyraz | Blocks | Free | 1 dep | |
| Brand Hero Blockbrand-hero-block | poyraz | Blocks | Free | 1 dep | |
| Dashboard Shell Blockdashboard-shell-block | poyraz | Blocks | Free | 1 dep | |
| Footer Blocksfooter-blocks | poyraz | Blocks | Free | 1 dep | |
| Glass App Shell Blockglass-app-shell-block | poyraz | Blocks | Free | 1 dep | |
| Image Cardimage-card | poyraz | Blocks | Free | no deps | |
| Mega Menu Blockmega-menu-block | poyraz | Blocks | Free | 1 dep |
