TagInput 标签输入输入后回车变成标签,常用于关键词、白名单。复制 Markdown预览代码reacttailwind10.0.0.1 安装复制链接 pnpmnpmbunyarn手动复制代码pnpm dlx shadcn@latest add https://docs.linasan.cn/r/tag-input.json第一次装本站的组件前先在项目里执行一次 shadcn init,详见 安装。 用法复制链接 复制代码import { TagInput } from '@/components/form/tag-input'; <TagInput value={tags} onChange={setTags} normalize={(s) => s.trim() || null} /> 属性复制链接 属性类型valuearrayonChangefunctionplaceholder?stringnormalize?functioninvalid?uniondisabled?unionclassName?stringaria-label?stringSecretInput 密钥输入填写 AccessKey、密码这类密钥:已保存的只显示掩码,要改时再输入。Select 选择器从下拉列表里选一项。SimpleSelect 直接传选项数组。