一组交互式单选按钮,每次只能选择一个选项。
¥API Reference
此组件继承了 单选按钮组基础组件 的属性并支持 常用边距属性。
¥This component inherits props from the Radio Group primitive and supports common margin props.
¥Root
包含单选按钮组的所有部分。
¥Contains all the parts of a radio group.
¥Item
组中可勾选的项目。
¥An item in the group that can be checked.
¥Examples
¥Size
使用 size
属性控制单选按钮的大小。
¥Use the size
prop to control the radiobutton size.
¥Variant
使用 variant
属性控制单选按钮的视觉样式。
¥Use the variant
prop to control the visual style of the radio buttons.
¥Color
使用 color
属性指定特定的 color。
¥Use the color
prop to assign a specific color.
¥High-contrast
使用 highContrast
属性增加与背景的颜色对比度。
¥Use the highContrast
prop to increase color contrast with the background.
¥Alignment
在 Text
中组合 RadioGroup.Item
,会自动将其与第一行文本居中。
¥Composing RadioGroup.Item
within Text
automatically centers it with the first line of text.
它还能自动与多行文本对齐。
¥It is automatically well-aligned with multi-line text too.
¥Disabled
使用原生 disabled
属性创建禁用的单选按钮。
¥Use the native disabled
attribute to create a disabled radiobutton.