
Svelte Tel Input
Lightweight svelte tel/phone input standardizer.
The package is in BETA stage, expect bugs.
Installation
Svelte Tel Input is distributed via npm.
npm install --save svelte-tel-input
Usage
Basic
REPL (StackBlitz)
<script lang="ts">
import { TelInput } from 'svelte-tel-input';
import type { NormalizedTelNumber, CountryCode } from 'svelte-tel-input/types';
let country: CountryCode = 'US';
let parsedTelInput: NormalizedTelNumber | null = null;
</script>
<TelInput {country} bind:parsedTelInput class="any class passed down" />
(back to top)
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.
(back to top)
Dependencies
libphonenumber-js
(back to top)
Changelog
(back to top)
Roadmap
See the open issues for a list of proposed features (and known issues).
(back to top)
Support

(back to top)
License
Distributed under the MIT License. See LICENSE.md for more information.
(back to top)