@citizenshipper/widgets-react
v1.0.3
Published
This module is distributed via [npm](https://www.npmjs.com) and should be installed as one of your project's `dependencies`:
Downloads
45
Readme
Installation
This module is distributed via npm and should be installed as one of your project's dependencies
:
npm install @citizenshipper/widgets-react
This package also depends on
react
. Please make sure you have it installed as well.
Usage
import * as React from 'react';
import { DogShipmentPriceEstimate } from "@citizenshipper/widgets-react"
const dog = {
name: "Remy",
breed: "Australian Shepherd",
}
const pickupAddress = {
city: "Dallas",
stateCode: "TX",
lat: 32.779167,
lng: -96.808891,
zipCode: "75001", // can be optional
}
const apiKey = "YOUR_API_KEY"
function App() {
return <DogShipmentPriceEstimate dog={dog} pickupAddress={pickupAddress} apiKey={apiKey} />
}
Props
| Prop | Type | Required | Description | ----------- | ----------- | ----------- | ----------- | dog | object | true | dog related data like name and breed | pickupAddress | object | true | address related data like city, state code, lat, lng and zip code. Zip code is optional | apiKey | string | true | google api key
dog
Type: object
, required: true
const dog = {
name: "Remy",
breed: "Australian Shepherd",
}
pickupAddress
Type: object
, required: true
const pickupAddress = {
city: "Dallas",
stateCode: "TX",
lat: 32.779167,
lng: -96.808891,
zipCode: "75001",
}
apiKey
Type: string
, required: true
const apiKey = "AIzaSyC1qY_rest_of_the_key"