Vertical#

Radio Group vertical example rendered by the production Go component.

Enable JavaScript to run the preview. Go source and install commands remain available.

Usage
plan := tree.Sub(page, tree.Name("plan"))
options := []components.RadioOption{
    {ID: plan.At(0), Label: "Personal"},
    {ID: plan.At(1), Label: "Team"},
    {ID: plan.At(2), Label: "Enterprise"},
}
group := components.BeginRadioGroup(canvas, theme, bounds, options, selected)
if id, ok := group.Paint().Clicked(); ok {
    selected = id
}

Horizontal#

Radio Group horizontal example rendered by the production Go component.

Enable JavaScript to run the preview. Go source and install commands remain available.

Usage
plan := tree.Sub(page, tree.Name("plan"))
options := []components.RadioOption{
    {ID: plan.At(0), Label: "Personal"},
    {ID: plan.At(1), Label: "Team"},
    {ID: plan.At(2), Label: "Enterprise"},
}
group := components.BeginRadioGroup(canvas, theme, bounds, options, selected)
if id, ok := group.Horizontal().Paint().Clicked(); ok {
    selected = id
}

States#

Radio Group states example rendered by the production Go component.

Enable JavaScript to run the preview. Go source and install commands remain available.

Usage
plan := tree.Sub(page, tree.Name("plan"))
options := []components.RadioOption{
    {ID: plan.At(0), Label: "Personal"},
    {ID: plan.At(1), Label: "Team", Invalid: true},
    {ID: plan.At(2), Label: "Enterprise", Disabled: true},
}
group := components.BeginRadioGroup(canvas, theme, bounds, options, selected)
if id, ok := group.Paint().Clicked(); ok {
    selected = id
}

Installation

Copy the recipe into your own project.

Repository command
go run ./cmd/viva add --out ./components/local radio-group

Source-owned usage#

This preview calls the production Go component directly. Stable IDs, values and open state remain owned by the application; the component only paints and declares interaction semantics.

  • Read the linked component source for every option and visual decision.
  • Use the native command to verify system text, focus, accessibility and platform integration.
  • The browser preview validates shared layout and scene behavior, not native performance.

Verification boundary#

The examples cover representative states supported by the current API. They do not imply that every desktop backend has completed hardware validation.

Keyboard

Use Tab to move between controls and Ctrl/⌘ K to search the catalog. Inside a preview, the Go runtime handles keyboard input.