shadcn.io is an independent project built on shadcn/ui
The button always reads Language. The menu checks one language, starting at English, with a flag beside each language's own name.
Use it when the locale is a single choice people set rarely. If the current name should show while closed, put it on the button or use a Select. In React, Base UI stores the code and does not translate the page.
Installation
Anatomy

Usage
<DropdownMenu>
<DropdownMenuTrigger render={<Button variant="outline" />}>
<LanguagesIcon aria-hidden="true" data-icon="inline-start" />
Language
</DropdownMenuTrigger>
<DropdownMenuContent className="w-48">
<DropdownMenuRadioGroup onValueChange={setLanguage} value={language}>
<DropdownMenuLabel>Select Language</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuRadioItem value="en">
<span className="flex items-center gap-2">
<span aria-hidden="true">🇺🇸</span>
<span>English</span>
</span>
</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="es">
<span className="flex items-center gap-2">
<span aria-hidden="true">🇪🇸</span>
<span>Español</span>
</span>
</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="fr">
<span className="flex items-center gap-2">
<span aria-hidden="true">🇫🇷</span>
<span>Français</span>
</span>
</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="de">
<span className="flex items-center gap-2">
<span aria-hidden="true">🇩🇪</span>
<span>Deutsch</span>
{/* The rest of the file is under Installation. */}FAQ
How is the language stored?
As one code, en to start, in a radio group: en, es, fr, de, ja or zh. Picking a row stores its code and moves the check.
DropdownMenuRadioGroup takes value, and onValueChange receives the new code.
What does each row show?
A flag emoji, hidden from screen readers with aria-hidden, then the language's name in that language. Flags stand for countries, not languages, so the name is what people read.
Does the button show the current language?
No. The outline button always reads Language, after a languages icon, and the check in the menu shows the choice. Print the current name in the button if people should see it without opening the menu.
Can two languages be selected?
No. The radio group holds one code, so picking Français unchecks English.
API Reference
Dropdown Menu
Sets onValueChange={setLanguage}, value={language}, value="en", value="es", value="fr" and value="de". The rest is on the Dropdown Menu page.
Button
Sets variant="outline". The rest is on the Button page.






