select-library
v1.2.3
Published
## Run Locally
Readme
SelectMenuLibrary
Run Locally
- run
nvm useto get the correct node version - run yarn to get dependecies
yarn storybookto see different use casesyarn testto run test cases- use examples from side menu to see different versions
Usage
There is already a published version on npm, if you want to add your own you can follow below setps
Using published. version
change the package name in package.json
Run
yarn buildRun
yarn publishuse your npm credentials to upload the package
add to your project with
yarn add ad-test-selectuse as import { Select } from 'ad-test-select'
<Select {...propsHere}/>
- to test local version without publising
- cd atlas-ds-challenge
- yarn build
- yarn link
- cd node_modules/react
- yarn link
- cd ../../node_modules/react-dom
- yarn link
- cd YOUR_PROJECT
- yarn link atlas-ds-challenge
- 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)
};