Socket
Book a DemoInstallSign in
Socket

svelte-tel-input

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-tel-input

svelte-tel-input

Source
npmnpm
Version
0.14.1
Version published
Weekly downloads
8.9K
-30.58%
Maintainers
1
Weekly downloads
 
Created
Source

npm version

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';

	// Any Country Code Alpha-2 (ISO 3166)
	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

PackageChangelog
@gyurielf/svelte-tel-inputChangelog

(back to top)

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).

(back to top)

Support

Buy Me A Coffee

(back to top)

License

Distributed under the MIT License. See LICENSE.md for more information.

(back to top)

Keywords

svelte

FAQs

Package last updated on 20 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts