Dialog
Dialog - Default
A dialog component with support for multiple locales
Loading...
Usage
The Language Switcher component provides an elegant way to switch between different languages in your application. It uses next-intl for internationalization and integrates seamlessly with Next.js routing.
import { LanguageSwitcher } from "@/components/elements/language-switcher"
export default function Example() {
return <LanguageSwitcher />
}Features
- Automatically detects and displays current language
- Smooth locale switching
- RTL support for Arabic language
- Dropdown menu interface
- Uses Languages icon from Lucide icons
- Customizable size and styling
Implementation
The component uses:
next-intlfor internationalization- Next.js router for locale switching
- Dropdown menu for language selection
- Radix UI for accessible dropdown components
Props
The LanguageSwitcher component accepts the following props:
Prop
Type
Dependencies
{
"next-intl": "latest",
"lucide-react": "latest",
"@radix-ui/react-dropdown-menu": "latest"
}