LocaleSwitcher
stableLocale selection dropdown with flag, native name, BCP 47 code, and RTL indicator. Two variants: compact (icon+code) and full (flag+name).
import { LocaleSwitcher } from "@nodus/design-system"Loading demo…
Props
| Prop | Type | Default | Description |
|---|---|---|---|
valuereq | string | — | Current locale code (BCP 47) |
onChangereq | (locale: string) => void | — | Called when the user selects a new locale |
variant | "compact" | "full" | "full" | compact: flag + code; full: flag + native name |
locales | LocaleOption[] | — | Available locales. Defaults to DS_LOCALES (7 locales: en-US, ar-SA, he-IL, zh-CN, ja-JP, de-DE, fr-FR) |
disabled | boolean | false | Disable the switcher |
label | string | "Switch locale" | aria-label for the trigger button |
valuerequiredType
stringDefault —Current locale code (BCP 47)
onChangerequiredType
(locale: string) => voidDefault —Called when the user selects a new locale
variantType
"compact" | "full"Default "full"compact: flag + code; full: flag + native name
localesType
LocaleOption[]Default —Available locales. Defaults to DS_LOCALES (7 locales: en-US, ar-SA, he-IL, zh-CN, ja-JP, de-DE, fr-FR)
disabledType
booleanDefault falseDisable the switcher
labelType
stringDefault "Switch locale"aria-label for the trigger button
Design Rationale
This component was designed to express:
Explore Related
Was this helpful?