跳转到主要内容
标题

文本输入

允许用户输入和编辑文本。
import { TextInput } from "@/ui/input/components/TextInput";

export const MyComponent = () => {
  const handleChange = (text) => {
    console.log("输入已更改:", text);
  };

  const handleKeyDown = (event) => {
    console.log("按下的键:", event.key);
  };

  return (
    <TextInput
      className
      label="用户名"
      onChange={handleChange}
      fullWidth={false}
      disableHotkeys={false}
      error="用户名无效"
      onKeyDown={handleKeyDown}
      RightIcon={null}
    />
  );
};
},{

自动调整大小的文本输入

根据内容自动调整高度的文本输入组件。
import { AutosizeTextInput } from "@/ui/input/components/AutosizeTextInput";

export const MyComponent = () => {
  return (
    <AutosizeTextInput
      onValidate={() => console.log("onValidate 函数已触发")}
      minRows={1}
      placeholder="写一条评论"
      onFocus={() => console.log("onFocus 函数已触发")}
      variant="icon"
      buttonTitle
      value="任务: "
    />
  );
};

文本区域

允许你创建多行文本输入。
import { TextArea } from "@/ui/input/components/TextArea";

export const MyComponent = () => {
  return (
    <TextArea
    disabled={false}
    minRows={4}
    onChange={()=>console.log('onChange 函数已触发')}
    placeholder="在此输入文本"
    value=""
    />
  );
};