GitHub - gyurielf/svelte-tel-input: Svelte Tel Input
source link: https://github.com/gyurielf/svelte-tel-input
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Svelte Tel Input
Lightweight svelte tel/phone input standardizer.
Under development!
Do not use it before 1.0, it won't works properly!
Lightweight phone input standardization.
Installation
Svelte Tel Input is distributed via npm.
npm install --save svelte-tel-input
Usage
<script lang="ts">
import { TelInput } from 'svelte-tel-input';
import type { CountryCode } from 'svelte-tel-input'
// Any Country Code Alpha-2 (ISO 3166)
let country: CountryCode = 'US'
let parsedPhoneInput: NormalizedPhoneNumber | null = null;
</script>
<TelInput {country} bind:parsedPhoneInput class="any class passed down" />
Features
- Parse and validate phone number.
- Standardize parsed phone numbers. You can store one exact format, no matter how users type their phone numbers.
- Mask typed inputs (country specificly), to make it more readable.
- Automatically set the user's current country using an IP lookup.
Dependencies
Changelog
Roadmap
- Add Changelog
- Add CI/CD
- Integrate libphonenumber
- Implement parser
- Add basics docs and examples
- Add advanced examples
- Improve A11Y
- Default country sould be optional. ( ip | browserLang |off )
- Simlify code and types
- Multi-language Support
See the open issues for a list of proposed features (and known issues).
Support
License
Distributed under the MIT License. See LICENSE.md
for more information.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK