输入框
嵌入表面的输入框,支持标签、提示、错误信息和输入框组。
本页内容
文本输入框嵌在表面的凹槽中,边缘由半像素轮廓勾勒。聚焦时,输入框抬升至面板层级,显示一道墨色轮廓和柔和的光晕。在 <input> 和 <textarea> 上使用 .input,并在包裹输入框的 <label> 上使用 .field。
输入框
<label class="field"> Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"></label><label className="field"> Email <input className="input" type="email" autoComplete="email" placeholder="you@example.com" /></label><label class="field"> Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"></label><template> <label class="field"> Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"> </label></template>#提示与错误
用 aria-describedby 将提示或错误信息关联到对应字段,用 aria-invalid="true" 标记无效值。field-error 仅在字段无效时显示,并在显示期间替代提示,因此两者都可以预先写入标记。
提示与错误
<div class="field"> <label for="project-name">Project name</label> <input class="input" id="project-name" value="atlas" aria-describedby="name-hint"> <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span></div><div class="field"> <label for="project-domain">Domain</label> <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error"> <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span></div><> <div className="field"> <label htmlFor="project-name">Project name</label> <input className="input" id="project-name" defaultValue="atlas" aria-describedby="name-hint" /> <span className="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span> </div> <div className="field"> <label htmlFor="project-domain">Domain</label> <input className="input" id="project-domain" defaultValue="atlas" aria-invalid="true" aria-describedby="domain-error" /> <span className="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span> </div></><div class="field"> <label for="project-name">Project name</label> <input class="input" id="project-name" value="atlas" aria-describedby="name-hint"> <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span></div><div class="field"> <label for="project-domain">Domain</label> <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error"> <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span></div><template> <div class="field"> <label for="project-name">Project name</label> <input class="input" id="project-name" value="atlas" aria-describedby="name-hint"> <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span> </div> <div class="field"> <label for="project-domain">Domain</label> <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error"> <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span> </div></template>#原生验证
浏览器的原生约束也能触发这些状态,无需脚本。带有 required、type 或 pattern 的字段通过 :user-invalid 显示错误轮廓。该选择器在用户编辑字段或尝试提交后才会匹配,表单初始状态下不会匹配。field-error 会随错误轮廓一同显示。
原生验证
<form class="flex flex-col gap-md"> <div class="field"> <label for="work-email">Work email</label> <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error"> <span class="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span class="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" class="btn btn-primary self-start">Continue</button></form><form className="flex flex-col gap-md"> <div className="field"> <label htmlFor="work-email">Work email</label> <input className="input" id="work-email" type="email" autoComplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error" /> <span className="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span className="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" className="btn btn-primary self-start">Continue</button></form><form class="flex flex-col gap-md"> <div class="field"> <label for="work-email">Work email</label> <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error"> <span class="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span class="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" class="btn btn-primary self-start">Continue</button></form><template> <form class="flex flex-col gap-md"> <div class="field"> <label for="work-email">Work email</label> <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error"> <span class="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span class="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" class="btn btn-primary self-start">Continue</button> </form></template>#尺寸
输入框的高度为 32、38 或 44px,与按钮、下拉选择框和分段控件的尺寸一致。同尺寸的控件可以在同一行齐平排列,无论使用鼠标还是手指:在触摸屏上,输入框保持原有高度和字号,由页面的视口设置避免 iOS 缩放页面。
尺寸
<input class="input input-sm" placeholder="Small" aria-label="Small"><input class="input" placeholder="Medium" aria-label="Medium"><input class="input input-lg" placeholder="Large" aria-label="Large"><> <input className="input input-sm" placeholder="Small" aria-label="Small" /> <input className="input" placeholder="Medium" aria-label="Medium" /> <input className="input input-lg" placeholder="Large" aria-label="Large" /></><input class="input input-sm" placeholder="Small" aria-label="Small"><input class="input" placeholder="Medium" aria-label="Medium"><input class="input input-lg" placeholder="Large" aria-label="Large"><template> <input class="input input-sm" placeholder="Small" aria-label="Small"> <input class="input" placeholder="Medium" aria-label="Medium"> <input class="input input-lg" placeholder="Large" aria-label="Large"></template>#多行文本框
带有 .input 的 <textarea> 保留指定的行数,并提供垂直调整大小的手柄。添加 input-auto 可让它随内容增高。field-sizing: content 将高度限制在 3 到 12 行之间,超过 12 行后可滚动。设置 --input-rows 和 --input-max-rows 可调整此范围。浏览器不支持 field-sizing 时,文本框会保留最小高度和调整手柄。
多行文本框
<label class="field"> Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea></label><label class="field"> Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea></label><> <label className="field"> Message <textarea className="input" rows={3} placeholder="A fixed height with a resize handle">{``}</textarea> </label> <label className="field"> Notes <textarea className="input input-auto" placeholder="Keep typing: this one grows with its content">{``}</textarea> </label></><label class="field"> Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea></label><label class="field"> Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea></label><template> <label class="field"> Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea> </label> <label class="field"> Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea> </label></template>#输入框组
input-group 用一个凹槽容纳无外框的输入框及其附属元素,例如图标、单位、快捷键或按钮。输入框组通过 :has() 呈现内部字段的悬停、聚焦、无效和禁用状态。字段本身是 input-group-field,保留输入语义和文本光标。将输入框组设为 <label>,点击凹槽任意位置即可聚焦字段。
输入框组
<label class="input-group"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="7" cy="7" r="4.5" /><path d="M10.182 10.182L14 14" /> </svg> <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects"> <kbd class="kbd">⌘K</kbd></label><label class="input-group"> <span class="input-group-addon">https://</span> <input class="input-group-field" value="atlas" aria-label="Subdomain"> <span class="input-group-addon">.master.co</span></label><label class="input-group"> <input class="input-group-field" type="number" value="24" aria-label="Timeout"> <span class="input-group-addon">seconds</span></label>import SearchIcon from '@master/icons-react/native/16/soft/search'<> <label className="input-group"> <SearchIcon className="icon" /> <input className="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects" /> <kbd className="kbd">⌘K</kbd> </label> <label className="input-group"> <span className="input-group-addon">https://</span> <input className="input-group-field" defaultValue="atlas" aria-label="Subdomain" /> <span className="input-group-addon">.master.co</span> </label> <label className="input-group"> <input className="input-group-field" type="number" defaultValue="24" aria-label="Timeout" /> <span className="input-group-addon">seconds</span> </label></><script> import SearchIcon from '@master/icons-svelte/native/16/soft/search'</script><label class="input-group"> <SearchIcon class="icon" /> <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects"> <kbd class="kbd">⌘K</kbd></label><label class="input-group"> <span class="input-group-addon">https://</span> <input class="input-group-field" value="atlas" aria-label="Subdomain"> <span class="input-group-addon">.master.co</span></label><label class="input-group"> <input class="input-group-field" type="number" value="24" aria-label="Timeout"> <span class="input-group-addon">seconds</span></label><script setup>import SearchIcon from '@master/icons-vue/native/16/soft/search'</script><template> <label class="input-group"> <SearchIcon class="icon" /> <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects"> <kbd class="kbd">⌘K</kbd> </label> <label class="input-group"> <span class="input-group-addon">https://</span> <input class="input-group-field" value="atlas" aria-label="Subdomain"> <span class="input-group-addon">.master.co</span> </label> <label class="input-group"> <input class="input-group-field" type="number" value="24" aria-label="Timeout"> <span class="input-group-addon">seconds</span> </label></template>组内的按钮距凹槽边缘 4px,圆角半径比凹槽小 4px,因此两者在各种尺寸下都保持同心。组内有按钮时,用 <div> 作为容器。
带按钮
<form class="input-group"> <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email"> <button type="submit" class="btn btn-primary">Subscribe</button></form><div class="input-group input-group-sm"> <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link"> <button type="button" class="btn">Copy</button></div><> <form className="input-group"> <input className="input-group-field" type="email" autoComplete="email" placeholder="you@example.com" aria-label="Email" /> <button type="submit" className="btn btn-primary">Subscribe</button> </form> <div className="input-group input-group-sm"> <input className="input-group-field" defaultValue="https://atlas.dev/p/9f2c" readOnly aria-label="Share link" /> <button type="button" className="btn">Copy</button> </div></><form class="input-group"> <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email"> <button type="submit" class="btn btn-primary">Subscribe</button></form><div class="input-group input-group-sm"> <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link"> <button type="button" class="btn">Copy</button></div><template> <form class="input-group"> <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email"> <button type="submit" class="btn btn-primary">Subscribe</button> </form> <div class="input-group input-group-sm"> <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link"> <button type="button" class="btn">Copy</button> </div></template>如果要将输入框和按钮分开,用 flex 将它们排在同一行,如 <form class="flex gap-xs"> 所示。
#输入多个值
input-group-wrap 让输入框组可以接收多个值,例如收件人、标签或筛选条件。每个值在凹槽中显示为一个胶囊标签,输入框占据最后一行的剩余空间,值排不下时凹槽就增加一行。胶囊标签距凹槽边缘 6px,圆角与凹槽同心。
样式表负责排列各个值。标签输入按 Enter 添加一个值;在空的输入框中按 Backspace 会先移到最后一个值,再按一次才会删除它;多值组合框则从列表中选择这些值。
输入多个值
<div class="field max-w(420) mx-auto"> <label for="input-teams">Teams</label> <div class="input-group input-group-wrap"> <span class="chip"> Design<button type="button" class="chip-remove" aria-label="Remove Design"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <span class="chip"> Research<button type="button" class="chip-remove" aria-label="Remove Research"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <span class="chip"> Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <span class="chip"> Operations<button type="button" class="chip-remove" aria-label="Remove Operations"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <input class="input-group-field" id="input-teams" placeholder="Add a team"> </div></div>import XIcon from '@master/icons-react/native/16/soft/x'<div className="field max-w(420) mx-auto"> <label htmlFor="input-teams">Teams</label> <div className="input-group input-group-wrap"> <span className="chip"> Design<button type="button" className="chip-remove" aria-label="Remove Design"> <XIcon className="icon" /> </button> </span> <span className="chip"> Research<button type="button" className="chip-remove" aria-label="Remove Research"> <XIcon className="icon" /> </button> </span> <span className="chip"> Engineering<button type="button" className="chip-remove" aria-label="Remove Engineering"> <XIcon className="icon" /> </button> </span> <span className="chip"> Operations<button type="button" className="chip-remove" aria-label="Remove Operations"> <XIcon className="icon" /> </button> </span> <input className="input-group-field" id="input-teams" placeholder="Add a team" /> </div></div><script> import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="field max-w(420) mx-auto"> <label for="input-teams">Teams</label> <div class="input-group input-group-wrap"> <span class="chip"> Design<button type="button" class="chip-remove" aria-label="Remove Design"> <XIcon class="icon" /> </button> </span> <span class="chip"> Research<button type="button" class="chip-remove" aria-label="Remove Research"> <XIcon class="icon" /> </button> </span> <span class="chip"> Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering"> <XIcon class="icon" /> </button> </span> <span class="chip"> Operations<button type="button" class="chip-remove" aria-label="Remove Operations"> <XIcon class="icon" /> </button> </span> <input class="input-group-field" id="input-teams" placeholder="Add a team"> </div></div><script setup>import XIcon from '@master/icons-vue/native/16/soft/x'</script><template> <div class="field max-w(420) mx-auto"> <label for="input-teams">Teams</label> <div class="input-group input-group-wrap"> <span class="chip"> Design<button type="button" class="chip-remove" aria-label="Remove Design"> <XIcon class="icon" /> </button> </span> <span class="chip"> Research<button type="button" class="chip-remove" aria-label="Remove Research"> <XIcon class="icon" /> </button> </span> <span class="chip"> Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering"> <XIcon class="icon" /> </button> </span> <span class="chip"> Operations<button type="button" class="chip-remove" aria-label="Remove Operations"> <XIcon class="icon" /> </button> </span> <input class="input-group-field" id="input-teams" placeholder="Add a team"> </div> </div></template>#搜索与自动填充
type="search" 字段保留浏览器的清除按钮,并用图标的墨色将其绘制为纤细的叉号。浏览器自动填充字段时,凹槽改用淡淡的信息色,覆盖浏览器引擎默认的黄色或蓝色,使填充后的表单保持原有风格。
搜索
<input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"><input className="input max-w(360) mx-auto" type="search" defaultValue="moonstone" aria-label="Search" /><input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"><template> <input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"></template>#文件
在 <input type="file"> 上,浏览器自带的按钮呈现为小型凸起控件,嵌在凹槽中,如同分段控件轨道中的一个选项。
文件
<label class="field">Attachment <input class="input" type="file"></label><label className="field">Attachment <input className="input" type="file" /></label><label class="field">Attachment <input class="input" type="file"></label><template> <label class="field">Attachment <input class="input" type="file"></label></template>#日期、时间、数字和颜色
.input 为浏览器原生的日期、时间、数字和颜色字段绘制相同的凹槽。字段继续使用用户熟悉的设备原生选择器。颜色字段呈正方形,色样向内缩进 4px,圆角与外框同心。
浏览器在这些字段中显示的小标记按图标的线宽和墨色重新绘制。日历或时钟图标用于打开选择器,数字字段用一对折角符号逐步调整数值,上方的增大数值,下方的减小数值。Chromium 和 Safari 开放这些部件供样式定制,Firefox 保留原生样式。如果用户需要频繁逐步调整数值,请使用步进器。
日期、时间、数字和颜色
<label class="field">Starts <input class="input" type="date" value="2026-11-11"></label><label class="field">At <input class="input" type="time" value="09:30"></label><label class="field"> Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"></label><label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label><> <label className="field"> Starts <input className="input" type="date" defaultValue="2026-11-11" /> </label> <label className="field">At <input className="input" type="time" defaultValue="09:30" /></label> <label className="field"> Timeout in seconds <input className="input" type="number" min="0" step="5" defaultValue="30" /> </label> <label className="field"> Accent <input className="input" type="color" defaultValue="#5b4fe0" /> </label></><label class="field">Starts <input class="input" type="date" value="2026-11-11"></label><label class="field">At <input class="input" type="time" value="09:30"></label><label class="field"> Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"></label><label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label><template> <label class="field">Starts <input class="input" type="date" value="2026-11-11"></label> <label class="field">At <input class="input" type="time" value="09:30"></label> <label class="field"> Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"> </label> <label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label></template>#字段集
在 <fieldset> 上使用 fieldset,可将相关控件归到同一个组标题下,并去掉浏览器默认的凹纹边框。fieldset-legend 让 <legend> 采用字段标签的样式。用它包住一组复选框、单选按钮或选项,为这组控件命名。
字段集
<fieldset class="fieldset"> <legend class="fieldset-legend">Notify me about</legend> <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label> <label class="check"> <input type="checkbox" class="checkbox" checked> Expiring certificates </label> <label class="check"><input type="checkbox" class="checkbox"> Product news</label></fieldset><fieldset className="fieldset"> <legend className="fieldset-legend">Notify me about</legend> <label className="check"> <input type="checkbox" className="checkbox" defaultChecked /> Failed deployments </label> <label className="check"> <input type="checkbox" className="checkbox" defaultChecked /> Expiring certificates </label> <label className="check"><input type="checkbox" className="checkbox" /> Product news</label></fieldset><fieldset class="fieldset"> <legend class="fieldset-legend">Notify me about</legend> <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label> <label class="check"> <input type="checkbox" class="checkbox" checked> Expiring certificates </label> <label class="check"><input type="checkbox" class="checkbox"> Product news</label></fieldset><template> <fieldset class="fieldset"> <legend class="fieldset-legend">Notify me about</legend> <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label> <label class="check"> <input type="checkbox" class="checkbox" checked> Expiring certificates </label> <label class="check"><input type="checkbox" class="checkbox"> Product news</label> </fieldset></template>#禁用
禁用
<div class="field"> <label for="custom-domain">Custom domain</label> <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason"> <span class="field-hint" id="custom-domain-reason">Custom domains come with the Team plan.</span></div><div className="field"> <label htmlFor="custom-domain">Custom domain</label> <input className="input" id="custom-domain" defaultValue="atlas.dev" disabled aria-describedby="custom-domain-reason" /> <span className="field-hint" id="custom-domain-reason"> Custom domains come with the Team plan. </span></div><div class="field"> <label for="custom-domain">Custom domain</label> <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason"> <span class="field-hint" id="custom-domain-reason">Custom domains come with the Team plan.</span></div><template> <div class="field"> <label for="custom-domain">Custom domain</label> <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason"> <span class="field-hint" id="custom-domain-reason"> Custom domains come with the Team plan. </span> </div></template>#React、Svelte 和 Vue
field 组件通过 ID 将标签、控件、提示和错误信息关联起来。控件仍由页面提供自己的标记,本页其余示例也都直接使用标记。用 npx master-ui add field 将组件复制到项目中。组件的构建和用法见 React、Svelte 和 Vue。
#类名
| 类名 | 说明 |
|---|---|
input | 将文本 input、文件 input 或 textarea 绘成凹槽,也适用于浏览器的日期、时间、数字、搜索和颜色字段 |
input-sm | 高度为 32px。默认高度为 38px,与按钮等高。与 input 一同使用 |
input-lg | 高度为 44px。默认高度为 38px,与按钮等高。与 input 一同使用 |
input-auto | textarea 随内容从 --input-rows 行增高到 --input-max-rows 行,超过上限后滚动与 input 一同使用 |
input-group | 用同一个凹槽包住无外框的字段及其图标、附加项或按钮,并呈现内部字段的悬停、聚焦、无效和禁用状态。 |
input-group-sm | 将组的高度设为 32px,默认高度为 38px与 input-group 一同使用 |
input-group-lg | 将组的高度设为 44px,默认高度为 38px与 input-group 一同使用 |
input-group-wrap | 将多个值显示为胶囊标签的输入组,随内容换行逐行增高。值的添加和移除由页面脚本处理,或通过与服务器的一次请求和响应完成。与 input-group 一同使用 |
input-group-field | 输入组内不带独立外框的原生字段,保留原生语义和文本插入光标。 |
input-group-addon | 值旁的固定文本,例如协议、单位或域名 |
field | 标签叠在控件上方,下方可加说明。只包含文字和控件时可用 label 元素;有提示或错误信息时,改用包含带 for 的 label 的 div,让说明成为控件的描述,而不是名称的一部分。 |
field-hint | 控件下方以弱化墨色显示的提示。在字段内显示错误时,提示让位给错误信息 |
field-error | 错误消息,仅在字段中有控件无效时显示。 |
field-help | 标签后面的问号,使用柔和的前景色并加上点状下划线,用来显示工具提示:一个以 interestfor 和 popovertarget 指向该工具提示的按钮。它与标签并排在同一行,不可放在标签内 |
fieldset | 用 fieldset 将相关控件归在同一标题下,并去除浏览器默认的凹槽边框 |
fieldset-legend | legend 是字段组的标题,采用字段标签的样式。 |
#自定义属性
| 属性 | 默认值 | 说明 |
|---|---|---|
--input-height | 2.375rem | 输入框或输入组的最小块轴尺寸,适用于所有指针类型。 |
--input-padding-x | .75rem | 输入框或输入组在行内方向的内边距 |
--input-font-size | .875rem | 字号 |
--input-radius | var(--radius-control) | 默认圆角半径为 10px,小尺寸用 8px,大尺寸用 12px |
--input-rows | 3 | input-auto textarea 显示的最少行数在 input-auto 上设置 |
--input-max-rows | 12 | input-auto textarea 在开始滚动前可自动扩展到的最大行数。在 input-auto 上设置 |