{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ribbon-card",
  "type": "registry:component",
  "title": "Ribbon card",
  "description": "Highlight a plan, release, or announcement with a compact ribbon label.",
  "categories": [
    "layout"
  ],
  "dependencies": [],
  "registryDependencies": [
    "card",
    "badge"
  ],
  "files": [
    {
      "path": "src/registry/overtrue/ribbon-card.tsx",
      "type": "registry:component",
      "target": "components/overtrue/ribbon-card.tsx",
      "content": "import { Badge } from \"@/components/ui/badge\";\nimport type { ReactNode } from \"react\";\nimport { SectionCard, type SectionCardProps } from \"./section-card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface RibbonCardProps extends SectionCardProps {\n  ribbon?: ReactNode;\n  ribbonPosition?: \"top\" | \"text\";\n}\nexport function RibbonCard({\n  ribbon,\n  ribbonPosition = \"top\",\n  className,\n  children,\n  actions,\n  ...props\n}: RibbonCardProps) {\n  const badge =\n    ribbon != null ? (\n      <Badge className=\"h-auto max-w-full gap-1 rounded-full border-transparent bg-primary px-2.5 py-0.5 text-xs leading-5 font-medium whitespace-normal text-primary-foreground shadow-[inset_0_1px_0_rgb(255_255_255/0.22),0_1px_2px_rgb(0_0_0/0.12)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.22),0_1px_2px_rgb(0_0_0/0.08),0_4px_14px_-4px_color-mix(in_oklab,var(--color-primary)_60%,transparent)]\">\n        {ribbon}\n      </Badge>\n    ) : null;\n  return (\n    <SectionCard\n      data-slot=\"ribbon-card\"\n      data-ribbon-position={ribbonPosition}\n      className={cn(\n        \"relative\",\n        ribbon != null &&\n          ribbonPosition === \"top\" &&\n          \"bg-[radial-gradient(55%_60%_at_100%_0%,color-mix(in_oklab,var(--color-primary)_9%,transparent),transparent_70%)]\",\n        className,\n      )}\n      actions={\n        ribbonPosition === \"top\" ? (\n          <>\n            {badge}\n            {actions}\n          </>\n        ) : (\n          actions\n        )\n      }\n      {...props}\n    >\n      {children}\n      {ribbonPosition === \"text\" && badge && (\n        <div className=\"mt-4\">{badge}</div>\n      )}\n    </SectionCard>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/section-card.tsx",
      "type": "registry:component",
      "target": "components/overtrue/section-card.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport {\n  Card,\n  CardContent,\n  CardHeader,\n  CardTitle,\n  CardDescription,\n} from \"@/components/ui/card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SectionCardProps extends Omit<\n  ComponentProps<typeof Card>,\n  \"title\"\n> {\n  title?: ReactNode;\n  description?: ReactNode;\n  actions?: ReactNode;\n  contentClassName?: string;\n}\n\n/** A shared heading, actions and content surface for admin panels. */\nexport function SectionCard({\n  title,\n  description,\n  actions,\n  children,\n  className,\n  contentClassName,\n  ...props\n}: SectionCardProps) {\n  return (\n    <Card\n      data-slot=\"section-card\"\n      className={cn(\n        \"min-w-0 gap-0 rounded-2xl border border-border/70 bg-card py-0 text-card-foreground ring-0\",\n        \"shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)]\",\n        className,\n      )}\n      {...props}\n    >\n      {(title || description || actions) && (\n        <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-x-4 gap-y-3 border-b border-border/60 px-5 py-4 [.border-b]:pb-4\">\n          <div data-slot=\"section-card-heading\" className=\"min-w-0 flex-1\">\n            {title && (\n              <CardTitle className=\"m-0 text-sm leading-6 font-semibold tracking-tight text-card-foreground\">\n                {title}\n              </CardTitle>\n            )}\n            {description && (\n              <CardDescription className=\"m-0 mt-0.5 text-[13px] leading-5 text-muted-foreground\">\n                {description}\n              </CardDescription>\n            )}\n          </div>\n          {actions && (\n            <div\n              data-slot=\"section-card-actions\"\n              className=\"flex shrink-0 items-center gap-2\"\n            >\n              {actions}\n            </div>\n          )}\n        </CardHeader>\n      )}\n      <CardContent className={cn(\"p-5\", contentClassName)}>\n        {children}\n      </CardContent>\n    </Card>\n  );\n}\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/components/ribbon-card. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
