card.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import type { HTMLAttributes } from "react";
  2. import { cn } from "@/lib/utils";
  3. export function Card({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
  4. return (
  5. <div
  6. className={cn(
  7. "rounded-lg border border-border bg-card text-foreground",
  8. className,
  9. )}
  10. {...props}
  11. />
  12. );
  13. }
  14. export function CardHeader({
  15. className,
  16. ...props
  17. }: HTMLAttributes<HTMLDivElement>) {
  18. return (
  19. <div
  20. className={cn("flex flex-col gap-1.5 p-5", className)}
  21. {...props}
  22. />
  23. );
  24. }
  25. export function CardTitle({
  26. className,
  27. ...props
  28. }: HTMLAttributes<HTMLHeadingElement>) {
  29. return (
  30. <h3
  31. className={cn("text-base font-semibold leading-none", className)}
  32. {...props}
  33. />
  34. );
  35. }
  36. export function CardDescription({
  37. className,
  38. ...props
  39. }: HTMLAttributes<HTMLParagraphElement>) {
  40. return (
  41. <p
  42. className={cn("text-sm text-muted-foreground", className)}
  43. {...props}
  44. />
  45. );
  46. }
  47. export function CardContent({
  48. className,
  49. ...props
  50. }: HTMLAttributes<HTMLDivElement>) {
  51. return <div className={cn("p-5 pt-0", className)} {...props} />;
  52. }
  53. export function CardFooter({
  54. className,
  55. ...props
  56. }: HTMLAttributes<HTMLDivElement>) {
  57. return (
  58. <div className={cn("flex items-center p-5 pt-0", className)} {...props} />
  59. );
  60. }