Skip to content
daisyBlazor

Radio

A RadioGroup holds the selected value; each Radio inside it offers one option. Both are generic over T, and Radio infers T from its group.
Data input.radioReplaces MudRadioGroup
Cover · <RadioGroup>

Replicas

Examples

Binding

Bind the group's Value; a Radio can be Disabled on its own.

Billing cycle

Selected: yearly

website/Examples/DataInput/RadioBasicExample.razor Source

Typed values

T can be any type; for value types such as int or an enum, give each radio an Option.

Running 3 replicas

website/Examples/DataInput/RadioTypedExample.razor Source

Colors and sizes

Color and Size are set per radio.

Color.Tertiary

website/Examples/DataInput/RadioColorsExample.razor Source

API

<RadioGroup<T>>

DaisyBlazor

Parameters

  • Horizontal bool
    = false

    Lays the radios out in a wrapping row instead of the default vertical stack.

  • Label string
    = null

    Visible caption for the group; also names the radiogroup for assistive technology (aria-labelledby).

  • Value T
    = null

    The currently selected option (two-way bindable).

  • Class string
    = null

    Extra CSS classes merged onto the root element.

  • Style string
    = null

    Inline CSS styles applied to the root element.

Events

  • ValueChanged EventCallback<T>

    Raised when a child Radio is selected.

Content

  • ChildContent RenderFragment

    The Radio components of the group, stacked vertically unless Horizontal is set.

<Radio<T>>

DaisyBlazor

Parameters

  • Color Color
    = Color.Default

    Radio color, mapped to daisyUI radio-{color} (Tertiary maps to radio-accent).

  • Disabled bool
    = false

    Disables the radio so it cannot be selected.

  • Label string
    = null

    Text rendered next to the radio button.

  • Option T
    = null

    Alias of Value; when set it takes precedence as the value this radio represents.

  • Size Size
    = Size.Medium

    Radio size: Small (radio-sm), Medium (default) or Large (radio-lg).

  • Value T
    = null

    The value this radio represents (MudBlazor: Value or Option).

  • Class string
    = null

    Extra CSS classes merged onto the wrapping label element.

  • Style string
    = null

    Inline CSS styles applied to the wrapping label element.

Content

  • ChildContent RenderFragment

    Extra content rendered inside the label after the radio and Label text.

From MudRadioGroup

RadioGroup keeps MudRadioGroup's parameter names, so most markup moves over by dropping the Mud prefix. See the migration guide for the shared enums, icons and services.

<MudRadioGroup> <RadioGroup>
Something went wrong while running the docs. Reload