Skip to content
Tennantite
中文
Documentation

Input

Black text field with a 1 GUI px gray border that turns white on focus.

Install

CLI copy

$npx shadcn add @tennantite/input

npm install

$pnpm add @tennantite/ui

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

Usage

npm import

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

CLI copy import

import { Input } from "@/components/tennantite/input";
import { useState } from "react";

import { Input } from "./index";

/**
 * Input 预览用例:聊天框 + 受控值
*/
export function InputDemo() {
  const [value, setValue] = useState("");

  return (
    <div className="flex w-160 flex-col gap-8">
      <Input placeholder="按 T 聊天…" />
      <Input
        onChange={(event) => {
          setValue(event.target.value);
        }}
        placeholder="铁砧改名"
        value={value}
      />
      <Input disabled placeholder="禁用态" />
    </div>
  );
}

API Reference

No public props.

Source

packages/ui/src/primitives/input/index.tsx

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