Control
Updated: Aug 29, 2026
Control components allow users to make selections or toggle settings. The Meta VR UI Set SDK provides a checkbox, a radio button, and a switch. Each control renders compact artwork inside an interaction target of at least 48 dp, which meets the
Android design requirements at both Standard and Compact dimensions.
Each control is stateless. Hold the value in your own state, pass it in, and update it from the change callback. Pass null as the callback when a parent row owns the click and the accessibility semantics, and set contentDescription when no visible label describes the control.
- Usage: Options that can be selected independently of each other, such as items in a settings list.
- Appearance: A rounded square that draws a check mark when selected.
- Parameters:
checked, onCheckedChange, contentDescription, enabled, colors, dimensions, shape, indication.
import metavrx.uiset.compose.control.Checkbox
var subscribed by remember { mutableStateOf(false) }
Checkbox(
checked = subscribed,
onCheckedChange = { subscribed = it },
contentDescription = "Subscribe to updates",
)
- Usage: One option in a mutually exclusive group. Render one radio button per option and let the group state decide which is selected.
- Appearance: A circle that draws a center dot when selected.
- Parameters:
selected, onClick, contentDescription, enabled, colors, dimensions, indication.
import metavrx.uiset.compose.control.RadioButton
val sizes = listOf("Small", "Medium", "Large")
var selectedSize by remember { mutableStateOf(sizes.first()) }
sizes.forEach { size ->
RadioButton(
selected = size == selectedSize,
onClick = { selectedSize = size },
contentDescription = size,
)
}
- Usage: A setting that takes effect as soon as it changes, such as turning notifications on or off.
- Appearance: A pill-shaped track with a thumb that slides between the two states. Pass
thumbContent to place an icon inside the thumb. - Parameters:
checked, onCheckedChange, contentDescription, thumbContent, enabled, colors, dimensions, shape, thumbShape, indication.
import metavrx.uiset.compose.control.Switch
var notificationsOn by remember { mutableStateOf(true) }
Switch(
checked = notificationsOn,
onCheckedChange = { notificationsOn = it },
contentDescription = "Notifications",
)
Switch validates its geometry: switchHeight must be at least visualSize, and switchWidth must be at least switchHeight. A custom ControlDimensions value that breaks either constraint throws IllegalArgumentException.
contentDescription: String? = null: Accessibility label for a control with no adjacent text label.enabled: Boolean = true: Controls interactivity and applies the disabled colors.colors: CheckboxColors, RadioButtonColors, or SwitchColors for the selected, unselected, and disabled states.dimensions: ControlDimensions: Artwork size, switch track and thumb geometry, radio dot size, border width, and mark stroke.indication: UiSetIndicationSpec?: Press, hover, and focus feedback.modifier: Modifier = Modifier: Applied to the interaction target, not the smaller artwork.
Use a checkbox for independent options, a radio button for one choice out of a set, and a switch for a setting that applies immediately.