nylas-locale-switch
Overview
The nylas-locale-switch
component is a UI component that allows users to select a timezone and language.
Version | 1.1.4 |
Install (React) | npm install @nylas/react |
Import (React) | import { NylasLocaleSwitch } from '@nylas/react'; |
Import (CDN) | <script type="module">
import { defineCustomElement } from "https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/nylas-locale-switch/nylas-locale-switch.es.js";
defineCustomElement();
</script> |
Example
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
selectedLanguage | The selected language. | string | navigator.language | |
selectedTimezone | The selected timezone. | string | Intl.DateTimeFormat().resolvedOptions().timeZone |
Events
Event | Description | Type |
---|---|---|
languageChanged | This event is fired when the language is changed. | CustomEvent<string> |
timezoneChanged | This event is fired when the timezone is changed. | CustomEvent<string> |
Shadow Parts
Part | Description |
---|---|
"nls" | The locale switch container |
"nls__language" | The language select container |
"nls__language-drop-button" | The language dropdown button |
"nls__language-drop-content" | The language dropdown content |
"nls__language-drop-label" | The language dropdown label |
"nls__language-dropdown" | The language dropdown |
"nls__timezone" | The timezone select container |
"nls__timezone-drop-button" | The timezone dropdown button |
"nls__timezone-drop-button-selected-label" | The timezone dropdown button selected label |
"nls__timezone-drop-content" | The timezone dropdown content |
"nls__timezone-drop-label" | The timezone dropdown label |
"nls__timezone-dropdown" | The timezone dropdown |
Built with StencilJS