Skip to content
Press Alt + L to go back to the navigator language
LanguageSelector ⚠️ Experimental
The LanguageSelector component can be used imported from:
Playground
Parameters
Events
This component has events. Check the documentation about how to use the events.
Name | Payload | Description |
---|---|---|
change | string | Emitted when the value changes |
blur | void | Emitted when the input loses focus |
Parameters use
Check the documentation about how to use the parameters.
INFO
Most of the parameters are exactly the same as Select
component. Check its parameters section for more information.
model
Attention!
If you hardcode this value, it will not be reactive and the selection won't change. Use a variable instead and, ideally, a closed loop.
Controls the selected value of the input. The value needs to be one of the provided via locales
locales
it indicates the array of locales to display can be specified. Substitutes options
in the Select
component.
If no locales are provided, the component will use the ones injected in the ZDS_LOCALES
variable of window
. Read about this in the localization section
Special uses
Back to navigator language
If you press Alt + L, the component will change the language back to the navigator language. This is a default behavior that doesn't require special configuration.
We might want to provide the user this information with a toast if the language is to a different one than the navigator:
Browser support
Detected engine:
Chromium
Webkit
Gecko