0.2.1 • Published 3 years ago
hadock404-plugin v0.2.1
DropDown plugin
hadock404-plugin is a simple ready to integrate component made in React
Installation
Simply run the following command
npm i hadock404-plugin
Integration
React Integration:
import React, { useState } from 'react';
import { HaDock404Plugin } from 'hadock404-plugin';
......
const [value, setValue] = useState(null)
const [data, setData] = useState({.......})
......
function manipulateData(e) {
setData(data => ({...data, ...{'Key':`${e.getAttribute('data')}`}}))
}
......
<HaDock404Plugin
dropdownMessage={'Select'}
onDataReceived={manipulateData}
tabWordsList={[{word: 'Example'}]}
value={value}
onChange={setValue}>
</HaDock404Plugin>Options
The options are passed in as props when used as a React component.
| Option | Type | Description |
|---|---|---|
| dropdownMessage | string | Message appearing in the dropdown. |
| dropdownBackgroundColor | string | Color of the dropdown. |
| dropdownWidth | string | Width of the dropdown. |
| dropdownHeight | string | Height of the dropdown. |
| dropdownColor | string | Color of the text. |
| dropdownFontweight | string | Weight of the text |
| dropdownFontsize | string | Size of the text |
| dropdownBorderradius | string | Border radius of the dropdown |
| modalBackgroundColor | string | Background color of the list item |
| modalMaxheight | string | Maximum height of the dropdown when it is open |
| tabWordsList | array | Array of list items |
Development
- Development server
npm start. - Continuously run tests on file changes
npm run watch-test; - Run tests:
npm test; - Build
npm run build;