Pixelact Card
pixelact-ui/cardFreeComponent
A simple card component.
Live preview
live · rendered by the registry
Rendered by Pixelact UI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://pixelactui.com/r/card.jsonSource
1import { type VariantProps, cva } from "class-variance-authority";23import { cn } from "@/lib/utils";45import {6 Card as ShadcnCard,7 CardAction as ShadcnCardAction,8 CardContent as ShadcnCardContent,9 CardDescription as ShadcnCardDescription,10 CardFooter as ShadcnCardFooter,11 CardHeader as ShadcnCardHeader,12 CardTitle as ShadcnCardTitle,13} from "@/components/ui/card";1415import "@/components/ui/pixelact-ui/styles/styles.css";1617export const cardVariants = cva("", {18 variants: {19 font: {20 normal: "",21 pixel: "pixel-font",22 },23 },24 defaultVariants: {25 font: "pixel",26 },27});2829export interface CardProps30 extends React.ComponentProps<"div">,31 VariantProps<typeof cardVariants> {32 asChild?: boolean;33}3435function Card({ ...props }: CardProps) {36 const { className, font } = props;3738 return (39 <ShadcnCard40 {...props}41 className={cn(42 "rounded-none border-0 bg-card shadow-(--pixel-box-shadow) box-shadow-margin",43 cardVariants({ font }),44 className45 )}46 />47 );48}4950function CardHeader({ ...props }: CardProps) {51 const { className } = props;5253 return <ShadcnCardHeader className={cn("", className)} {...props} />;54}5556function CardTitle({ ...props }: CardProps) {57 const { className } = props;5859 return (60 <ShadcnCardTitle61 className={cn("font-normal text-lg", className)}62 {...props}63 />64 );65}6667function CardDescription({ ...props }: CardProps) {68 const { className } = props;6970 return <ShadcnCardDescription className={cn(className)} {...props} />;71}7273function CardAction({ ...props }: CardProps) {74 const { className } = props;7576 return <ShadcnCardAction className={cn(className)} {...props} />;77}7879function CardContent({ ...props }: CardProps) {80 const { className } = props;8182 return <ShadcnCardContent className={cn(className)} {...props} />;83}8485function CardFooter({ ...props }: CardProps) {86 const { className } = props;8788 return (89 <ShadcnCardFooter90 data-slot="card-footer"91 className={cn(className)}92 {...props}93 />94 );95}9697export {98 Card,99 CardHeader,100 CardFooter,101 CardTitle,102 CardAction,103 CardDescription,104 CardContent,105};
What it pulls in
Other registry items
Files it writes
More from Pixelact UI
All 28 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Pixelact Accordionaccordion | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alertalert | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alert Dialogalert-dialog | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Avataravatar | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Badgebadge | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Breadcrumbbreadcrumb | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Buttonbutton | Pixelact UI | Components | Free | no deps · 3 files | |
| Pixelact Calendarcalendar | Pixelact UI | Components | Free | no deps · 2 files |
