Skip to content
Tennantite
中文
Documentation

Card

Three-part card: Panel + TitleBar + content block.

合成

Panel + TitleBar + 内容区块

分隔线上下

Install

CLI copy

$npx shadcn add @tennantite/card

npm install

$pnpm add @tennantite/ui

npm installs the compiled package; use the CLI copy above to adapt the source.

Usage

npm import

import { Card } from "@tennantite/ui";

CLI copy import

import { Card } from "@/components/tennantite/card";
import { Divider } from "../divider/index";
import { Card } from "./index";

/**
 * Card / TitleBar / Divider 预览用例(规格 §5 #5)
*/
export function CardDemo() {
  return (
    <Card align="center" className="w-140" title="合成">
      <p className="font-mc mc-text">Panel + TitleBar + 内容区块</p>
      <Divider className="my-4" />
      <p className="font-mc mc-text text-mc-text-dim">分隔线上下</p>
    </Card>
  );
}

API Reference

PropTypeDescription
align"center" | "end" | "start"Title alignment, passed through to TitleBar.
titleReactNodeCard title (renders a TitleBar).

Source

packages/ui/src/containers/card/index.tsx

The npm package keeps the source tree, so you can copy and adapt it directly.