← Back to Wear Material Core
RadioButton
Overview
Code Examples
Video
RadioButton provides an animated radio button for use in material APIs.
@param modifier Modifier to be applied to the radio button. This can be used to provide a content description for accessibility. @param selected Boolean flag indicating whether this radio button is currently toggled on. @param enabled Boolean flag indicating the enabled state of the RadioButton (affects the color). @param ringColor Composable lambda from which the ring color of the radio button will be obtained. @param dotColor Composable lambda from which the dot color of the radio button will be obtained. @param onClick Callback to be invoked when RadioButton is clicked. If null, then this is passive and relies entirely on a higher-level component to control the state. @param interactionSource When also providing onClick, the MutableInteractionSource representing the stream of Interactions for the "toggleable" tap area - can be used to customise the appearance / behavior of the RadioButton. @param dotRadiusProgressDuration Duration of the dot radius progress animation. @param dotAlphaProgressDuration Duration of the dot alpha progress animation. @param dotAlphaProgressDelay Delay for the dot alpha progress animation. @param easing Animation spec to animate the progress. @param width Width of the radio button. @param height Height of the radio button.
Overloads
RadioButton
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Composable
fun RadioButton(
modifier: Modifier,
selected: Boolean,
enabled: Boolean,
ringColor: @Composable (enabled: Boolean, checked: Boolean) -> State<Color>,
dotColor: @Composable (enabled: Boolean, checked: Boolean) -> State<Color>,
onClick: (() -> Unit)?,
interactionSource: MutableInteractionSource,
dotRadiusProgressDuration: FunctionDotRadiusProgressDuration,
dotAlphaProgressDuration: Int,
dotAlphaProgressDelay: Int,
easing: CubicBezierEasing,
width: Dp,
height: Dp
)
Parameters
Name | Description |
---|---|
modifier | Modifier to be applied to the radio button. This can be used to provide a content description for accessibility. |
selected | Boolean flag indicating whether this radio button is currently toggled on. |
enabled | Boolean flag indicating the enabled state of the RadioButton (affects the color). |
ringColor | Composable lambda from which the ring color of the radio button will be obtained. |
dotColor | Composable lambda from which the dot color of the radio button will be obtained. |
onClick | Callback to be invoked when RadioButton is clicked. If null, then this is passive and relies entirely on a higher-level component to control the state. |
interactionSource | When also providing onClick, the MutableInteractionSource representing the stream of Interactions for the "toggleable" tap area - can be used to customise the appearance / behavior of the RadioButton. |
dotRadiusProgressDuration | Duration of the dot radius progress animation. |
dotAlphaProgressDuration | Duration of the dot alpha progress animation. |
dotAlphaProgressDelay | Delay for the dot alpha progress animation. |
easing | Animation spec to animate the progress. |
width | Width of the radio button. |
height | Height of the radio button |