Skip to content
Tennantite
中文
Documentation

TitleBar

Pixel-font window title with start / center / end alignment.

合成

居中标题(默认)

左对齐
右对齐

Install

CLI copy

$npx shadcn add @tennantite/title-bar

npm install

$pnpm add @tennantite/ui

npm 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

PropTypeDefaultDescription
align"center" | "end" | "start""center"Title alignment.
titleReactNode—Title content.

Source

packages/ui/src/containers/title-bar/index.tsx

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