Git Product home page Git Product logo

ad-test-select's Introduction

SelectMenuLibrary

Run Locally

  • run nvm use to get the correct node version
  • if version v15.2.1 is absent, please add it or a compatible version
  • run yarn to get dependecies
  • run yarn storybook to see different use cases
  • run yarn test to run test cases
  • use examples from side menu to see different versions

Usage

Using published. version

There is already a published version on npm, as ad-test-select

  • add to your project with yarn add ad-test-select
  • use as import { Select } from 'ad-test-select'

<Select {...propsHere}/>

Publishing your own version

If you want to publish your own package with some changes you can follow below steps

  • change the package name in package.json

  • Run yarn build

  • Run yarn publish

  • use your npm credentials to upload the package

  • add to your project with yarn add ${your_package_name}

  • use as

import { Select } from ${your_package_name}

<Select {...propsHere}/>

Using local. version

  • to test local build version without publising it to npm
      • cd ad-test-select
      • yarn build
      • yarn link
      • cd node_modules/react
      • yarn link
      • cd ../../node_modules/react-dom
      • yarn link
      • cd YOUR_PROJECT
      • yarn link ad-test-select
      • yarn link react
      • yarn link react-dom

import { Select } from 'ad-test-select'

<Select {...propsHere}/>

Props

Typescript types are exported, below is the list of props for reference

Syntax Description Required
menuOptions menu options for select true
searchable boolean (enable search) false
searchPlaceHolder string (place holder for search) false
onChange function true
selected preselcted value false
renderOption extended function to provide custom menu items false
isMenuOpen boolean false
searchPlaceHolder string false
dropDownlabel string false
  selected = {
    value: string;
    label?: string; (not required)
  };

ad-test-select's People

Contributors

amangitprivate avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.