---
title: "Radio 컴포넌트 — zenit Zig UI"
description: "상호 배타적인 옵션에서 값 하나를 선택합니다.그룹 선택, value, name, 방향키 이동, 포커스 순서를 그룹이 관리합니다."
url: https://zenit.z.express/ko/components/radio
language: ko
alternate_en: https://zenit.z.express/components/radio.md
alternate_zh: https://zenit.z.express/zh/components/radio.md
alternate_es: https://zenit.z.express/es/components/radio.md
alternate_ja: https://zenit.z.express/ja/components/radio.md
alternate_fr: https://zenit.z.express/fr/components/radio.md
alternate_de: https://zenit.z.express/de/components/radio.md
project: zenit v0.1.0-alpha (Zig 0.15.2, macOS)
source: https://github.com/version-next/zenit
---

# Radio

`ui.widgets.RadioGroup`

상호 배타적인 옵션에서 값 하나를 선택합니다.

[Video](https://zenit.z.express/media/stories/radio.mp4?v=47a6bfed14)

**BEHAVIOR CONTRACT**

그룹 선택, value, name, 방향키 이동, 포커스 순서를 그룹이 관리합니다.

**RECORDED INTERACTION**

harness가 Option Y를 선택하면 그룹의 나머지 항목은 선택 해제됩니다.

`examples/storybook/stories.zig:433`

```zig
pub fn buildRadio(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const a = cx.allocator;
    const c = try col(cx, 16);

    const status = try ui.text(cx, "selected → (none)", .{ .font_size = 13, .color = light.color.fg_secondary });
    status.meta.ownership.meta.test_id = "story.radio.status";
    try c.appendChild(a, status);
    const radio_story = try cx.bindState(RadioStory, .{ .status = status });

    try c.appendChild(a, try label(cx, "Radio"));
    try c.appendChild(a, try W.Radio(.{ .label_text = "Selected", .checked = true, .value = "a", .name = "g" }).mount(scope, cx));
    try c.appendChild(a, try W.Radio(.{ .label_text = "Unselected", .checked = false, .value = "b", .name = "g" }).mount(scope, cx));

    try c.appendChild(a, try label(cx, "RadioGroup"));
    const opts = [_]ui.widgets.checkbox.RadioOption{
        .{ .value = "x", .label_text = "Option X" },
        .{ .value = "y", .label_text = "Option Y" },
        .{ .value = "z", .label_text = "Option Z" },
    };
    const group = try W.RadioGroup(.{
        .options = &opts,
        .value = "x",
        .on_change = ui.Cx.strHandlerFrom(RadioStory, radio_story, RadioStory.onChange),
    }).mount(scope, cx);
    group.meta.ownership.meta.test_id = "story.radio.group";
    try c.appendChild(a, group);
    return c;
}
```

[GitHub에서 소스 보기examples/storybook/stories.zig:433](https://github.com/version-next/zenit/blob/HEAD/examples/storybook/stories.zig#L433)

Storybook에 있는 이 story의 원본 코드입니다(zenit 5f9add5+wip 2026-09-30). `W`는 `ui.widgets`이며, `col` / `row` / `label`은 Storybook 내부의 작은 레이아웃 헬퍼입니다.

### RadioGroupProps

`ui.widgets.RadioGroup`

[src/ui/components/checkbox/mod.zig:378](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/checkbox/mod.zig#L378)

```zig
fn RadioGroup(props: RadioGroupProps) RadioGroupBuilder
```

| 필드 | 타입 | 기본값 | 설명 |
| --- | --- | --- | --- |
| `options` | `[]const RadioOption` | — | — |
| `value` | `?[]const u8` | `null` | — |
| `name` | `[]const u8` | `""` | — |
| `horizontal` | `bool` | `false` | — |
| `disabled` | `bool` | `false` | — |
| `on_change` | `?core.HandlerRef` | `null` | — |
| `state_id` | `?u64` | `null` | — |

### RadioProps

`ui.widgets.Radio`

[src/ui/components/checkbox/mod.zig:286](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/checkbox/mod.zig#L286)

```zig
fn Radio(props: RadioProps) RadioBuilder
```

| 필드 | 타입 | 기본값 | 설명 |
| --- | --- | --- | --- |
| `checked` | `bool` | `false` | — |
| `label_text` | `?[]const u8` | `null` | — |
| `value` | `[]const u8` | `""` | — |
| `name` | `[]const u8` | `""` | — |
| `disabled` | `bool` | `false` | — |
| `on_change` | `?core.HandlerRef` | `null` | — |
| `_skip_interaction` | `bool` | `false` | 跳过内部交互注册（RadioGroup 统一管理时设 true） |

### \*Node

`ui.widgets.RadioGroup`

mount는 `*Node`을(를) 직접 반환합니다. 부모 노드에 append하면 됩니다.

### \*Node

`ui.widgets.Radio`

mount는 `*Node`을(를) 직접 반환합니다. 부모 노드에 append하면 됩니다.
