Field
标签、控件及其帮助文字连接在一起;错误使用提示消息,绝不显示在字段下方。
<Fieldset legend="New key" description="Applications use this key to call the gateway." className="w-400">
<Field label="Name" description="Shown in logs and the audit log.">
<Input placeholder="checkout-web" />
</Field>
<Field label="Expires" optional>
<Select
options={[
{ value: "never", label: "Never" },
{ value: "30", label: "In 30 days" },
{ value: "90", label: "In 90 days" },
]}
defaultValue="90"
/>
</Field>
</Fieldset>import { Field, Fieldset } from "@logicplanes/kaeso-ui";属性
descriptionReactNode标签下方的一句帮助文字。
errorReactNode错误信息:它会把字段标记为无效,并与描述一起朗读,但不会显示在字段下方,因此也请用 toast 显示它。
idstring内部控件的 ID,让标签指向它。
invalidboolean将字段标记为无效,但不显示消息。
labelReactNode字段的标签。
requiredboolean = false将字段标记为必填。