lt-dropdown-menu-jquery-to-react
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

lt-dropdown-menu-jquery-to-react

Get a conversion from jQuery DropDown Menu to React (JSX) ! https://github.com/jquery/jquery-ui/blob/master/ui/widgets/selectmenu.js

Installation

nodejs is required min v17 into your computer and you will use React min V.17 with this component !

# using npm
npm install lt-dropdown-menu-jquery-to-react

# using yarn
yarn add lt-dropdown-menu-jquery-to-react

Usage into React

# using import
import { DropDownSelect } from 'lt-dropdown-menu-jquery-to-react';

Example

Using promises:

<DropDownSelect
    className={"form-group"}
    id={"state"}
    title={"State"}
    dataArray={dataStates}
    keyToWatch={"name"}
    keyToValue={"abbreviation"}
    keyToValueDefaultValue={"AL"}
/>

Require differents Props :

  • className : Apply class Css for component
  • id : id to search into DOM result of the select tag.
  • title : text of the label tag
  • dataArray : array of objects (ex : [{"name" : "x", "value": "y"},{"name" : "a", "value": "b"} ]),
  • keyToWatch : key of object to assign into text of the option tag into select tag.
  • keyToValue : key of object to assign into value the option tag into select tag.
  • keyToValueDefaultValue : select default value of the option selected tag into select tag on launch of composant

Package Sidebar

Install

npm i lt-dropdown-menu-jquery-to-react

Weekly Downloads

11

Version

1.1.1

License

none

Unpacked Size

52.3 kB

Total Files

16

Last publish

Collaborators

  • litibe