Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-key-value
Advanced tools
##React-key-value
React key value is a key value visualiser/editor written in React
###Install
npm install react-key-value
###Usage
Include the main js module, e.g.:
var KeyValue = require('react-key-value');
// or ES6
import KeyValue from 'react-key-value';
###Props
This module has the following props:
####rows
<KeyValue rows=[{
keyItem: '',
valueItem: ''
}] />
By default rows
is empty. rows
has objects containing keyItem
and valueItem
strings.
####hideLabels
<KeyValue hideLabels={ true } />
It can be used for hiding the labels' texts (e.g. "Keys:" and "Values:"). Set to false
by default.
####keyInputPlaceholder
<KeyValue keyInputPlaceholder={ 'Key name' } />
You can set a placeholder text for the key input field.
####valueInputPlaceholder
<KeyValue valueInputPlaceholder={ 'Key name' } />
You can set a placeholder text for the value input field.
####onChange
<KeyValue onChange={ handleOnChange } />
onChange
is called every time when the rows
changes. onChange
gets the rows
array as the first function parameter.
####customAddButtonRenderer
You can create your own add button by the createAddButtonRenderer
function. If set, it takes the handleAddNew
function as the first parameter, which is responsible for the functionality of adding new fields in the KeyValue
component. You should pass it to the element's onClick
property.
Example:
<KeyValue
customAddButtonRenderer={ (handleAddNew) => (
<div>
<a
href="#"
onClick={ handleAddNew }
>
<span>+</span> Add new meta data
</a>
</div>
) }
onChange={ (rows) => console.log(rows) }
/>
###Development
To develop run npm start
.
You can test your changes by opening localhost:4567
in a browser.
When you are happy with your changes you can build to dist with npm run build
.
FAQs
Key value visualizer/editor written in React
The npm package react-key-value receives a total of 5,518 weekly downloads. As such, react-key-value popularity was classified as popular.
We found that react-key-value demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.