Docs
Radio Group

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.

Usage

import shadcn.ui.components.Label
import shadcn.ui.components.RadioGroup
import shadcn.ui.components.RadioGroupItem
RadioGroup {
    defaultValue = "option-one"
    div {
        className = ClassName("flex items-center space-x-2")
        RadioGroupItem {
            value = "option-one"
            id = "option-one"
        }
        Label {
            htmlFor = "option-one"
            +"Option One"
        }
    }
    div {
        className = ClassName("flex items-center space-x-2")
        RadioGroupItem {
            value = "option-two"
            id = "option-two"
        }
        Label {
            htmlFor = "option-two"
            +"Option Two"
        }
    }
}