单选组
用途
Include CSS
导入 Tailwind 和一个完整的 A3S UI 样式包。
或者仅导入基本 CSS、Radio Group 组件 CSS 和一个样式包。
Radio Group 在更丰富的示例中使用 Radio 样式并组合 Field 样式。
使用CDN或批量程序导入?请参见安装页。
Add your radio group HTML
Add class="input" to radio inputs. Use a shared name attribute for mutually exclusive options, and wrap related options in a semantic <fieldset> or an element with role="radiogroup".
示例
说明
使用 Field 组件进行单选组项目及其描述。
Standard spacing for most use cases.
More space between elements.
Minimal spacing for dense layouts.
选择卡
Use a native <label> to wrap the entire .field for a clickable card-style selection.
现场组
Use a native <fieldset> and <legend> to group radio items with a label and description.
已禁用
使用 disabled 属性禁用单个项目。
无效
在无线电输入上使用 aria-invalid="true",在字段上使用 data-invalid 以显示验证错误。
RTL
在无线电组或祖先上设置 dir="rtl"。
تباعد قياسي لمعظم حالات الاستخدام.
مساحة أكبر بين العناصر.
تباعد أدنى للتخطيطات الكثيفة.