1.3.1 • Published 2 years ago

nigeria-locations v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Locations in Ngeria

This package can easily be used with react project within form tag to get all locations in Nigeria.

All the 36 States and FCT

In the project directory, you can run:

  • Easy to add into existing project
  • Easy to style
  • Get selected location on one click

How to use

  • Install by executing npm install nigeria-locations or yarn add nigeria-locations.
  • Import by adding import States from 'nigeria-locations'.
  • Use by adding <States />. Use onSelect prop for getting new values.

Installation

Add nigeria-locations to your project by executing npm install nigeria-locations or yarn add nigeria-locations.

Usage

Here's an example of basic usage:

import React, { useState } from 'react';
import States from 'nigeria-locations';

function MyApp() {
  const onChange = (state) => {
    console.log(state);
  };

  return (
    <div>
      <States onSelect={onChange} />
    </div>
  );
}

User guide

nigeria-locations

Displays a complete, interactive select tag.

Styling

Prop nameDescription
select-tagUse this className to override the initial styling of the select tag
option-tagUse this className to override the initial styling of the tag tag
onSelectCreate a function and pass the function as a prop to tag
paramsIn the function created, pass a param in the function. Inside the function, you can get the value of the selected state, console the param in the function to see the selected state
1.3.1

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago