svelte-address-autocomplete
v0.1.5
Published
[![npm version](https://badge.fury.io/js/svelte-address-autocomplete.svg)](https://www.npmjs.com/package/svelte-address-autocomplete) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/JonasJs/svelte-address-autocomp
Downloads
30
Readme
Svelte Adress Autocomplete
Adress Autocomplete Component to Svelte
Installation
npm i svelte-address-autocomplete
// OR
yarn add svelte-address-autocomplete
Note: to use this library in sapper, install as devDependency. See the link.
Demo Link
Local demo:
git clone https://github.com/JonasJs/svelte-address-autocomplete.git
cd svelte-address-autocomplete
yarn install && yarn start
Examples
An example of how to use the library:
<script>
import AdressAutocomplete from "svelte-address-autocomplete"
</script>
<div class="form">
<h1>Svelte Adress Autocomplete</h1>
<AdressAutocomplete className="newName" let:data let:onBlur>
<label>Postal Code</label>
<input type="text" on:blur="{onBlur}" />
<h4>{data ? data.street : 'No address'}</h4>
</AdressAutocomplete>
</div>
<style>
label {
margin-bottom: 8px;
}
</style>
Properties
Component props:
| Prop | Type | Description | | --------- | ------ | -------------------------------------- | | className | string | Create a class to modify the component |
Events
| Prop | Type | Description | | -------- | ---- | --------------------------------- | | callback | func | callback with address information |
Address Informations
{
neighborhood,
zipCode,
complement,
city,
street,
fu,
}
Slot Properties
| Prop | Type | Description | | ----- | ------ | ------------------- | | data | object | Address Information | | error | any | Request exception |
NPM Statistics
Download stats for this NPM package
License
Svelte Adress Autocomplete is open source software licensed as MIT.