Card Variants
poyraz/card-variantsFreeComponent
Poyraz Soft Glass card-variants component.
Install it
npx shadcn@latest add https://ui.poyrazavsever.com/r/card-variants.jsonSource
1"use client";23import * as React from "react";4import { ChevronDown } from "lucide-react";56import { Badge } from "@/components/ui/atoms/badge";7import { Button } from "@/components/ui/atoms/button";8import {9 Card,10 CardAction,11 CardContent,12 CardDescription,13 CardFooter,14 CardHeader,15 CardHeading,16 CardImage,17 CardTitle,18 type CardProps,19} from "@/components/ui/atoms/card";20import { cn } from "@/lib/utils";2122type CompositionProps = CardProps;2324interface BasicContentCardProps extends Omit<CompositionProps, "title"> {25 title: React.ReactNode;26 description?: React.ReactNode;27 action?: React.ReactNode;28}2930function BasicContentCard({31 action,32 children,33 description,34 title,35 ...props36}: BasicContentCardProps) {37 return (38 <Card data-slot="basic-content-card" {...props}>39 <CardHeader>40 <CardHeading>41 <CardTitle>{title}</CardTitle>42 {description && <CardDescription>{description}</CardDescription>}43 </CardHeading>44 {action && <CardAction>{action}</CardAction>}45 </CardHeader>46 {children && <CardContent>{children}</CardContent>}47 </Card>48 );49}5051interface ImageContentCardProps extends Omit<CompositionProps, "title"> {52 src: string;53 alt: string;54 title: React.ReactNode;55 description?: React.ReactNode;56 category?: React.ReactNode;57 action?: React.ReactNode;58}5960function ImageContentCard({61 action,62 alt,63 category,64 description,65 src,66 title,67 ...props68}: ImageContentCardProps) {69 return (70 <Card data-slot="image-content-card" variant="interactive" className="group" {...props}>71 <CardImage>72 <img73 src={src}74 alt={alt}75 className="size-full object-cover transition-transform duration-300 group-hover:scale-[1.03]"76 />77 </CardImage>78 <CardHeader>79 <CardHeading>80 {category && (81 <Badge size="sm" className="mb-1 w-fit">82 {category}83 </Badge>84 )}85 <CardTitle>{title}</CardTitle>86 {description && <CardDescription>{description}</CardDescription>}87 </CardHeading>88 </CardHeader>89 {action && <CardFooter>{action}</CardFooter>}90 </Card>91 );92}9394interface HorizontalCardProps extends ImageContentCardProps {95 imageClassName?: string;96}9798function HorizontalCard({99 action,100 alt,101 category,102 description,103 imageClassName,104 src,105 title,106 ...props107}: HorizontalCardProps) {108 return (109 <Card110 data-slot="horizontal-card"111// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from poyraz
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | poyraz | Components | Free | 2 deps | |
| Alertalert | poyraz | Components | Free | 2 deps | |
| Announcement Barannouncement-bar | poyraz | Components | Free | 2 deps | |
| Autocompleteautocomplete | poyraz | Components | Free | 1 dep | |
| Avataravatar | poyraz | Components | Free | 2 deps | |
| Badgebadge | poyraz | Components | Free | 1 dep | |
| Bg Patternbg-pattern | poyraz | Components | Free | no deps | |
| Breadcrumbbreadcrumb | poyraz | Components | Free | 1 dep |
