{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card",
  "type": "registry:ui",
  "title": "Card",
  "description": "A React card for Next.js and Tailwind CSS: a surface for grouped content with header, action, content and footer parts, a small size and a link style.",
  "author": "FewTone <https://fewtone.com>",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "radix-ui@^1.7.0"
  ],
  "registryDependencies": [
    "https://ui.fewtone.com/r/tokens.json"
  ],
  "files": [
    {
      "path": "registry/fewtone/ui/card.tsx",
      "type": "registry:ui",
      "content": "import { cn } from \"@/lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"radix-ui\";\nimport type { ComponentProps } from \"react\";\n\n/*\n * A surface for grouped content (owner's roadmap, 2026-10-16), with shadcn's parts: Card, CardHeader, CardTitle,\n * CardDescription, CardAction, CardContent and CardFooter.\n * - Depth comes from a soft shadow and a hairline, not a border (design.md: few borders), the recipe of the site's\n *   own cards. The hairline is a ring, outside the box, so it never changes the layout.\n * - As a link (`asChild` with an `a`), the surface lifts a step on hover, to `muted`: colour only, nothing moves.\n *   The whole card is the link, with the focus ring round it, as Badge and Button do as links.\n * - `size=\"sm\"` tightens the padding and gaps from 24 to 16px, for dense grids such as stats and settings.\n * - The header is a grid. CardAction takes a second column beside the title and description; that column is\n *   implicit, so it sizes itself to the action without an arbitrary grid template.\n * - No motion and no \"use client\": it's a server component.\n */\n\nconst cardVariants = cva(\n  [\n    \"group/card flex flex-col rounded-lg bg-card text-card-foreground shadow-sm ring-1 ring-border\",\n    \"outline-ring focus-visible:outline-(length:--focus-ring-width) focus-visible:outline-offset-(--focus-ring-offset)\",\n    // A link card lifts a step on hover: the background only\n    \"[a&]:transition-colors [a&]:duration-(--duration-fast) [a&]:ease-out [a&]:hover:bg-muted\",\n  ],\n  {\n    variants: {\n      size: {\n        sm: \"gap-4 py-4\",\n        md: \"gap-6 py-6\",\n      },\n    },\n    defaultVariants: { size: \"md\" },\n  },\n);\n\nexport type CardProps = ComponentProps<\"div\"> &\n  VariantProps<typeof cardVariants> & {\n    /** Render the single child instead of a div, for example a link, keeping the card styles */\n    asChild?: boolean;\n  };\n\n/**\n * A surface for grouped content. It renders a `div`, or with `asChild` its single child, so a link can be a whole\n * card. Keep a link card short: everything inside it is read as the link's name.\n */\nfunction Card({ className, size, asChild = false, ...props }: CardProps) {\n  const Comp = asChild ? Slot.Root : \"div\";\n  return (\n    <Comp\n      data-slot=\"card\"\n      data-size={size ?? \"md\"}\n      className={cn(cardVariants({ size }), className)}\n      {...props}\n    />\n  );\n}\n\nfunction CardHeader({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-header\"\n      className={cn(\n        \"grid auto-rows-min grid-cols-1 items-start gap-x-4 gap-y-1.5 px-6 group-data-[size=sm]/card:px-4\",\n        // With a rule under it (className=\"border-b\"), the header keeps the card's padding below the rule\n        \"[.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** The card's title. A `div` by default; with `asChild`, a heading at the level the page needs (`<h3>`). */\nfunction CardTitle({ className, asChild = false, ...props }: ComponentProps<\"div\"> & { asChild?: boolean }) {\n  const Comp = asChild ? Slot.Root : \"div\";\n  return <Comp data-slot=\"card-title\" className={cn(\"leading-none font-semibold\", className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div data-slot=\"card-description\" className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n  );\n}\n\n/** Sits at the end of the header, beside the title and description: a button, a badge, a menu */\nfunction CardAction({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-action\"\n      className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction CardContent({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-content\"\n      className={cn(\"px-6 group-data-[size=sm]/card:px-4\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction CardFooter({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-footer\"\n      className={cn(\n        \"flex items-center gap-2 px-6 group-data-[size=sm]/card:px-4\",\n        \"[.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants };\n"
    }
  ],
  "categories": [
    "display"
  ],
  "docs": "Usage and examples: https://ui.fewtone.com/components/card"
}
