Nothing Special   »   [go: up one dir, main page]

1.1.14 • Published 5 years ago

super-input-field v1.1.14

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

super-input-field is a simple search text field. The search uses Fuse.js library which is a fuzzy search lightweight library.

Installation

Using npm

npm install --save super-input-field

make sure you have installed the peer dependencies as well

react
styled-components

Sample Code

Below is the sample code which initializes the component with the mock-data.

import React from "react";
import SuperField from "./SuperField";

class SuperInputField extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
          options : [
            {
                "firstName": "John",
                "lastName": "Doe",
                "title" : "Software Engineer",
                "department" : "IT",
                "img" : ""
              },
              {
                "firstName": "Dan",
                "lastName": "Pitt",
                "title" : "Building Supervisor",
                "department" : "Administration",
                "img" : ""
              },
              {
                "firstName": "Carter",
                "lastName": "Finlay",
                "title" : "Electrical Engineer",
                "department" : "Energy",
                "img" : ""
              }
              
          ]
        };
      }
    
      render() {
        return (
                <SuperField
                  options={this.state.options}
                  width={"30%"}
                />
              )}
}

export default SuperInputField;

Props

proptypedescription
optionsArrayAn array of data which is used for the search

Complete Source Code and Contributing

Kindly refer the github link for the full source code. Also, if you have any ideas on how to make this better? Open an issue!

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago