Svelte Timezone Picker
You need a timezone picker that will allow the user to pick a timezone from a list. You want it to be accessible and follow the ARIA design pattern for a select.
This is a component that controls all user interactions and state for you. It follows best practices and accessibility guidelines.
The timezones are all valid IANA time zones.
This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:
yarn add svelte-timezone-picker
npm i --save svelte-timezone-picker
If you are going to use the svelte component, make sure you have svelte installed as well.
To use it in your Svelte app, simply import it as a component.
To use it as a web component, add the
index.js file to your page and use it as a regular HTML element.
<!-- use the new timezone-picker element --><!-- link it as module script --><!-- listen for the update event on the picker -->
||String||The current timezone. Must be a valid timezone from IANA.||
||Boolean||Whether the dropdown should be automatically expanded or not.||
||Array||Control which timezones display in the list. Must be a valid timezone from IANA.||
||Dispatched every time you change the timezone.||An object with the selected timezone.|
You can use CSS variables to style the DOM elements of timezone-picker.
MIT License - fork, modify and use however you want.