Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
ActionsAndroid

Language toggle

Cycle to the next locale with a pill that shows that locale.

Public APILumenLanguageToggleAndroid / Compose

Native example

Use Language toggle

Use it for two or three locales. The host applies the locale; use a select for longer lists.

Language toggle rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
private val appLocales = listOf(
    LumenLocaleOption("English", "en"),
    LumenLocaleOption("Español", "es"),
    LumenLocaleOption("Français", "fr")
)

@Composable
fun LanguageSwitcher(language: String, onLanguageChange: (String) -> Unit) {
    LumenLanguageToggle(
        value = language,
        onValueChange = onLanguageChange,
        locales = appLocales
    )
}
Android
A pill that shows the next language and switches the app to it, cycling through English, Español, and Français.

Reference

Public API

The primary shared and platform-specific options exposed by LumenLanguageToggle.

APIValues or typeDefaultDescription
value / locales / labelTemplatecurrent locale / label and value pairs / accessible name templatefirst locale / English, Español / Change language from {current} to {next}Use it for two or three locales.

Native behavior

Design and accessibility

When to use it

Use it for two or three locales. The host applies the locale; use a select for longer lists.

Accessibility

The label reads the current and the next language.

Shared component

Available on other platforms

React NativeApple / SwiftUI Web
Android docsCompose module