For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/ui/components/radio-group.md.
lynx-ui logo
lynx-ui
  • 简体中文
  • RadioGroup

    一个适用于 ReactLynx 的无样式单选组组件,用于管理一组单选按钮的单选状态。

    基础用法

    禁用

    RadioGroup 支持整组禁用,也支持为单个选项设置禁用状态。

    结构

    <RadioGroupRoot>
      <Radio>
        <RadioIndicator />
      </Radio>
    </RadioGroupRoot>

    API

    RadioGroupRoot

    The root component of the RadioGroup, containing all of its child components.

    children
    iOS
    Android
    Harmony
    类型ReactNode | [object Object]
    子节点
    defaultValue
    iOS
    Android
    Harmony
    类型string
    RadioGroup 被选中的初始值。使用此属性意味着 RadioGroup 是非受控的。如果值不匹配任何一个 Radio 的值,RadioGroup 将不会被选中。
    disabled
    iOS
    Android
    Harmony
    类型boolean·默认值false
    如果设置为 true,RadioGroup 将不能接受交互。
    onValueChange
    iOS
    Android
    Harmony
    类型(value: string) => void
    选中状态改变时触发
    value
    iOS
    Android
    Harmony
    类型string
    RadioGroup 被选中的值。使用此属性意味着 RadioGroup 是受控的。如果值不匹配任何一个 Radio 的值,RadioGroup 将不会被选中。

    Radio

    The item inside RadioGroup.

    children
    iOS
    Android
    Harmony
    类型ReactNode
    子组件
    className
    iOS
    Android
    Harmony
    类型string
    类名
    disabled
    iOS
    Android
    Harmony
    类型boolean
    Radio 是否被禁用。如果设置为 true,则该 Radio 无法接受交互。
    radioProps
    iOS
    Android
    类型ViewProps
    Radio 支持将原始视图属性直接展开到这个属性中。
    style
    iOS
    Android
    Harmony
    类型CSSProperties
    样式
    value
    iOS
    Android
    Harmony
    类型string
    Radio 的标识

    RadioIndicator

    The check slot indicating this Radio is now selected. Normally a circle. It's children will only be rendered when selected so it can be a custom inner selected indicator. Can be a ReactNode or a render function returns a ReactNode.

    children
    iOS
    Android
    Harmony
    类型ReactNode
    子节点
    className
    iOS
    Android
    Harmony
    类型string
    类名
    forceMount
    iOS
    Android
    类型boolean·默认值false
    强制挂载子节点。如果设置为 true,即使 checked 为 false,子节点也会被挂载。
    style
    iOS
    Android
    Harmony
    类型CSSProperties
    样式
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。