RadioTile 磁贴单选
#
一系列可选的磁贴组件,其行为类似于 Radio。
从 5.35.0 版本开始支持 RadioTile。
获取组件
#
import { RadioTile, RadioTileGroup } from 'rsuite';
import RadioTile from 'rsuite/RadioTile';
import RadioTileGroup from 'rsuite/RadioTileGroup';
无障碍设计
#
WAI-ARIA: https://www.w3.org/TR/wai-aria-practices/#radiobutton
- 选中
RadioTile 时将 aria-checked 设置为 true。 否则,将 aria-checked 设置为 false。
Props
#
<RadioTile>
#
| Property |
Type (Default) |
Description |
| checked |
boolean |
被选中(受控) |
| defaultChecked |
boolean |
默认被选中 |
| disabled |
boolean |
禁用 |
| name |
string |
用于表单对应的名称 |
| onChange |
(value: string | number, event) => void |
checked 状态发生改变的回调函数 |
| value |
string | number |
对应 RadioTileGroup 的值,判断是否选中 |
<RadioTileGroup>
#
| Property |
Type (Default) |
Description |
| defaultValue |
string | number |
默认值 |
| disabled |
boolean |
禁用 |
| inline |
boolean |
水平布局 |
| name |
string |
用于表单对应的名称 |
| onChange |
(value:string | number, event) => void |
值改变后的回调 |
| value |
string | number |
值(受控) |