<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kole UI · 表单 Form（普通 H5）</title>
<link rel="stylesheet" href="../.design_library/kole-ui/colors_and_type.css"><link rel="stylesheet" href="Form.css">
<style>.demo{padding:24px;background:var(--kole-color-page-bg);font-family:var(--kole-font-family)}.demo h1{margin:0 0 4px;font-size:20px;color:var(--kole-color-text-title)}.sub{margin:0 0 20px;color:var(--kole-color-text-secondary);font-size:12px}.demo-block{padding:16px;margin-bottom:16px;background:var(--kole-color-card-bg);border:1px solid var(--kole-color-border);border-radius:var(--kole-radius-large)}.demo-block h2{margin:0 0 12px;font-size:14px;color:var(--kole-color-text-title)}.row{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.demo-note{margin:12px 0 0;color:var(--kole-color-text-secondary);font-size:12px}</style></head>
<body><div class="demo"><h1>表单 Form（纯 H5）</h1><p class="sub">统一字段布局、必填标识、校验错误和提交/重置流程。</p><div class="demo-block"><h2>默认与常用变体</h2><div class="row kole-form"><form class="kole-form-form" id="kole-form-form"><label class="kole-form-field"><span>名称 <b aria-hidden="true">*</b></span><input class="kole-form-control" name="name" required value="示例项目"></label><span class="kole-form-error" hidden>请输入名称</span><div class="kole-form-row"><button class="kole-form-button kole-form-primary" type="submit">提交</button><button class="kole-form-button" type="reset">重置</button></div></form></div></div><div class="demo-block"><h2>状态与使用场景</h2><div class="row kole-form"><div class="kole-form-surface" style="padding:12px">统一字段布局、必填标识、校验错误和提交/重置流程。</div><span class="kole-form-desc">支持键盘焦点、状态反馈和令牌化样式。</span></div><p class="demo-note">零运行时依赖；数据请求、权限和国际化由宿主接入方决定。</p></div></div><script>(function () { document.getElementById('kole-form-form').addEventListener('submit', function (e) { e.preventDefault(); this.querySelector('.kole-form-error').hidden = this.elements.name.value.trim() !== ''; }); }());</script></body></html>