Documentation
Card
Three-part card: Panel + TitleBar + content block.
合成
Panel + TitleBar + 内容区块
分隔线上下
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>
);
}
Install
CLI copy
$npx shadcn add @tennantite/cardnpm install
$pnpm add @tennantite/uinpm 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
| Prop | Type | Description |
|---|---|---|
| align | "center" | "end" | "start" | Title alignment, passed through to TitleBar. |
| title | ReactNode | Card title (renders a TitleBar). |
Source
packages/ui/src/containers/card/index.tsxThe npm package keeps the source tree, so you can copy and adapt it directly.