Documentation
TitleBar
Pixel-font window title with start / center / end alignment.
合成
居中标题(默认)
左对齐
右对齐
import { Panel } from "../panel/index";
import { TitleBar } from "./index";
export function TitleBarDemo() {
return (
<Panel className="w-160 p-8">
<TitleBar title="合成" />
<p className="mt-8 font-mc mc-text text-mc-text-dim">居中标题(默认)</p>
<TitleBar align="start" className="mt-8" title="左对齐" />
<TitleBar align="end" className="mt-8" title="右对齐" />
</Panel>
);
}
Install
CLI copy
$npx shadcn add @tennantite/title-barnpm install
$pnpm add @tennantite/uinpm installs the compiled package; use the CLI copy above to adapt the source.
Usage
npm import
import { TitleBar } from "@tennantite/ui";CLI copy import
import { TitleBar } from "@/components/tennantite/title-bar";import { Panel } from "../panel/index";
import { TitleBar } from "./index";
export function TitleBarDemo() {
return (
<Panel className="w-160 p-8">
<TitleBar title="合成" />
<p className="mt-8 font-mc mc-text text-mc-text-dim">居中标题(默认)</p>
<TitleBar align="start" className="mt-8" title="左对齐" />
<TitleBar align="end" className="mt-8" title="右对齐" />
</Panel>
);
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| align | "center" | "end" | "start" | "center" | Title alignment. |
| title | ReactNode | — | Title content. |
Source
packages/ui/src/containers/title-bar/index.tsxThe npm package keeps the source tree, so you can copy and adapt it directly.