Language Switcher
A compact language selector with a listbox dropdown, an inline segmented variant and typeahead.
Copy a prompt for your AI coding tool with the source, dependencies and usage
Props
LanguageSwitcherProps
Also accepts all props of Omit<React.ComponentProps<"div">, "defaultValue" | "onChange">
| Prop | Type | Default | Description |
|---|---|---|---|
| languages | Language[] | defaultLanguages | — |
| value | string | — | Selected language code (controlled) |
| defaultValue | string | — | — |
| onValueChange | (code: string) => void | — | — |
| variant | "dropdown" | "segmented" | "dropdown" | — |
| align | "start" | "end" | "start" | — |
| defaultOpen | boolean | false | Render the listbox open on mount (dropdown variant only, without moving focus) |
Install
$ npx shadcn@latest add https://chromotion.dev/r/language-switcher.json