Radio Group

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.

Description

Standard spacing for most use cases.

More space between elements.

Minimal spacing for dense layouts.

Choice Card

Fieldset

Subscription Plan

Yearly and lifetime plans offer significant savings.

Disabled

Notification Preferences

Choose how you want to receive notifications.

Invalid

Notification Preferences

Choose how you want to receive notifications.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::radio::*;

#[component]
pub fn RadioAnatomy() -> impl IntoView {
    view! {
        <RadioGroup>
            <Radio />
        </RadioGroup>
    }
}

API Reference

Radio

An item in the group that can be checked.

Custom Attributes
NameTypeDefaultDescription
checkedboolfalse

A reactive signal coupled to the radio button's checked value.

Implements global, input, and radio attributes.

RadioGroup

Contains all the parts of a radio group.

Custom Attributes
NameTypeDefaultDescription
defaultString""

Set or update the default selected value for the RadioGroup.

invalidboolfalse

A reactive signal that toggles whether all the children Radios appear invalid or not.

valueString""

A reactive value coupled to the currently selected Radio's value.

Implements global and fieldset attributes.