Components / Selection

Pop-up Button

현재 선택값을 표시하고 체크 표시가 있는 선택 메뉴를 엽니다.

CupertinoPopupButton View source ↗

Playground

Live Compose · Wasm
Preview

Click or drag inside the preview to try it out.

Properties

Usage example

Kotlin code for the current playground settings.

Example.kt
kotlin
import androidx.compose.runtime.*import androidx.compose.foundation.layout.*import androidx.compose.ui.Modifierimport androidx.compose.ui.unit.dpimport zone.ien.hig.*import zone.ien.hig.theme.*import androidx.compose.ui.graphics.Colorimport androidx.compose.ui.Alignment
@OptIn(ExperimentalCupertinoApi::class)@Composablefun Example() { CupertinoTheme(colorScheme = lightColorScheme(accent = Color(0xFF007AFF))) { Column(Modifier.fillMaxSize(), verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically)) { var expanded by remember { mutableStateOf(false) } var selected by remember { mutableIntStateOf(0) } CupertinoPopupButton( expanded = expanded, onExpandedChange = { expanded = it }, enabled = true, title = { CupertinoText(text = "선택 "+ (selected + 1)) }, ) { repeat(3) { index -> MenuPickerAction( isSelected = selected == index, onClick = { selected = index; expanded = false }, title = { CupertinoText(text = "항목 "+ (index + 1)) }, ) } } } }}

Run examples inside CupertinoTheme. For components using backdrop, attach layerBackdrop to the background content.