Home / File/ card.tsx — ui Source File

card.tsx — ui Source File

Architecture documentation for card.tsx, a tsx file in the ui codebase. 2 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 2 imports 7 functions

Entity Profile

Dependency Diagram

graph LR
  6aeaf5ac_5f0c_00b1_0d9d_87cf84c56ca0["card.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  6aeaf5ac_5f0c_00b1_0d9d_87cf84c56ca0 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  ef4051f4_aeb7_8d0c_a726_0ba96ad80cf6["utils"]
  6aeaf5ac_5f0c_00b1_0d9d_87cf84c56ca0 --> ef4051f4_aeb7_8d0c_a726_0ba96ad80cf6
  style 6aeaf5ac_5f0c_00b1_0d9d_87cf84c56ca0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as React from "react"

import { cn } from "@/registry/bases/radix/lib/utils"

function Card({
  className,
  size = "default",
  ...props
}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
  return (
    <div
      data-slot="card"
      data-size={size}
      className={cn("cn-card group/card flex flex-col", className)}
      {...props}
    />
  )
}

function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-header"
      className={cn(
        "cn-card-header group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
        className
      )}
      {...props}
    />
  )
}

function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-title"
      className={cn("cn-card-title", className)}
      {...props}
    />
  )
}

function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-description"
      className={cn("cn-card-description", className)}
      {...props}
    />
  )
}

function CardAction({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-action"
      className={cn(
        "cn-card-action col-start-2 row-span-2 row-start-1 self-start justify-self-end",
        className
      )}
      {...props}
    />
  )
}

function CardContent({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-content"
      className={cn("cn-card-content", className)}
      {...props}
    />
  )
}

function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-footer"
      className={cn("cn-card-footer flex items-center", className)}
      {...props}
    />
  )
}

export {
  Card,
  CardHeader,
  CardFooter,
  CardTitle,
  CardAction,
  CardDescription,
  CardContent,
}

Subdomains

Dependencies

  • react
  • utils

Frequently Asked Questions

What does card.tsx do?
card.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in card.tsx?
card.tsx defines 7 function(s): Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle.
What does card.tsx depend on?
card.tsx imports 2 module(s): react, utils.
Where is card.tsx in the architecture?
card.tsx is located at apps/v4/registry/bases/radix/ui/card.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/bases/radix/ui).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free