card
neobrutalui/cardFreeComponent
Group and organize related content into a contained unit.
Live preview
live · rendered by the registry
Rendered by neobrutalui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.neobrutalui.live/r/card.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"3import { cn } from "@/lib/utils"45const cardVariants = cva(6 "rounded-base border-2 border-black bg-white text-black shadow-brutal",7 {8 variants: {9 variant: {10 default: "",11 },12 },13 defaultVariants: {14 variant: "default",15 },16 }17)1819export type CardProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardVariants>2021const Card = React.forwardRef<HTMLDivElement, CardProps>(22 ({ className, variant, ...props }, ref) => (23 <div24 ref={ref}25 className={cn(cardVariants({ variant }), "p-4", className)}26 {...props}27 />28 )29)30Card.displayName = "Card"3132const CardHeader = React.forwardRef<33 HTMLDivElement,34 React.HTMLAttributes<HTMLDivElement>35>(({ className, ...props }, ref) => (36 <div37 ref={ref}38 className={cn("flex flex-col space-y-1.5 pb-2", className)}39 {...props}40 />41))42CardHeader.displayName = "CardHeader"4344const CardTitle = React.forwardRef<45 HTMLHeadingElement,46 React.HTMLAttributes<HTMLHeadingElement>47>(({ className, ...props }, ref) => (48 <h349 ref={ref}50 className={cn(51 "text-2xl font-bold",52 className53 )}54 {...props}55 />56))57CardTitle.displayName = "CardTitle"5859const CardContent = React.forwardRef<60 HTMLDivElement,61 React.HTMLAttributes<HTMLDivElement>62>(({ className, ...props }, ref) => (63 <div ref={ref} className={cn(className)} {...props} />64))65CardContent.displayName = "CardContent"6667const CardFooter = React.forwardRef<68 HTMLDivElement,69 React.HTMLAttributes<HTMLDivElement>70>(({ className, ...props }, ref) => (71 <div72 ref={ref}73 className={cn("flex items-center pt-6", className)}74 {...props}75 />76))77CardFooter.displayName = "CardFooter"7879export { Card, CardHeader, CardFooter, CardTitle, CardContent, cardVariants }
What it pulls in
Other registry items
More from neobrutalui
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalui | Components | Free | 2 deps | |
| alertalert | neobrutalui | Components | Free | 1 dep | |
| avataravatar | neobrutalui | Components | Free | no deps | |
| badgebadge | neobrutalui | Components | Free | 1 dep | |
| buttonbutton | neobrutalui | Components | Free | 1 dep | |
| checkboxcheckbox | neobrutalui | Components | Free | 2 deps | |
| date-pickerdate-picker | neobrutalui | Components | Free | 2 deps | |
| dialogdialog | neobrutalui | Components | Free | 2 deps |
