npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mui-autocomplete

v2.0.1

Published

Simple mui-autocomplete pacakge for autosuggestion made with React hooks, Material-UI and Axios.

Downloads

513

Readme

mui-autocomplete

mui-autocomplete is made with react hooks, axios and material-ui. A simple and easy installtion for making REST API calls, avatar view and much more. Our support team is available to help you if you will find any difficulty.Lets try it out and forget complex implementations.For information and product usage please visit our website so you will know what else you can expect from this plugin.

Github https://github.com/samrandhawa4/mui-autocomplete
Website http://toecoder.com/mui-autocomplete/

Getting Started

npm install --save mui-autocomplete

Dependencies

Material UI, React and Axios are needed to use this package.

Basic Usage

We assume that you have above three dependencies before using this package. After installation you can import this package into your react component Like this:-

import React from 'react';
import MuiAutocomplete from 'mui-autocomplete';
const cities = [
  {
    id: 1,
    name: "Alabama",
    code: "AL"
  },
  {
    id: 2,
    name: "Alaska",
    code: "AK"
  },
  {
    id: 3,
    name: "American Samoa",
    code: "AS"
  }];
function Home () {
    return (
      <div>
        <MuiAutocomplete
          placeholder="Countries"
          name="countries"
          setvalue={1}
          setdata={cities}
          variant="outlined"
          template={{
            title: 'name'
           }}
          />
      </div>
    );
}

Asynchronous Usage

We assume that you have above three dependencies before using this package. After installation you can import this package into your react component Like this:-

import React from 'react';
import MuiAutocomplete from 'mui-autocomplete';

function Home () {
    return (
      <div>
        <MuiAutocomplete
          placeholder="Countries"
          name="countries"
          setvalue={1}
          seturl="https://toecoder.com/mui-autocomplete/data.php?country="
          geturl="https://toecoder.com/mui-autocomplete/getdata.php?country="
          variant="outlined"
          template={{
            title: 'name'
           }}
          />
      </div>
    );
}

Server Side

Your backend file must return JSON data as a posts object. Example:-

  • PHP (https://github.com/samrandhawa4/countries/blob/master/countries.php)
// onSuccess
echo json_encode(array('status'=> 200, 'posts'=> $posts));

// onError
echo json_encode(array('status'=> 400, 'message'=> 'No record found.'));
  • Laravel (https://github.com/samrandhawa4/countries/blob/master/countriesController.php)
// onSuccess
return response()->json([
    'posts' => $posts,
    'status' => 200
], 200);

// onError
return response()->json([
    'error' => 'No Record Found',
    'status' => 422
], 200);

Built With

Support

Vist our website or send your query at [email protected].

Author

  • H S Randhawa(Summer)

License

The project is licensed under the terms of [MIT license]