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-split-button
Advanced tools
A carefully crafted split-button for React
$ npm install react-split-button --save
The split-button is similar to the dropdown button, but also enables a default action on the button, without showing the drop-down menu.
The split button smartly positions the drop-down menu to fit into the document. You can customize how the menu is aligned to the button. With one function, you can respond to a click in the menu at any nesting level.
Worth trying out, see the demo page
See Changelog
var SplitButton = require('react-split-button')
var items = [
{
label: 'save as',
onClick: function(){
console.log('saved as')
},
items: [
{
label: 'PDF',
onClick: function(){
console.log('save as PDF')
}
},
{
label: 'Postscript'
}
]
},
{
label: 'export',
onClick: function(){
console.log('exported')
}
},
]
function save(){
console.log('SAVED!')
}
<SplitButton items={items} onClick={save}>
Save
</SplitButton>
function onMenuClick(event, itemProps){
console.log('You clicked ', itemProps.data.label)
}
<SplitButton items={items} onMenuClick={onMenuClick} onClick={save}>
Save
</SplitButton>
The split button is implemented as two buttons, one next to the other (named button
and arrow
from now on). The arrow
button is just a react-dropdown-button
href - href
for the button
align - applied to the button
label - applied to the button
disabled - applied to the button and the arrow
pressed - applied to the button
defaultPressed - applied to the button
theme - a theme to apply the button and the arrow. See buttom styling
buttonProps - props for the button
arrowProps - props for the arrow
commonProps - props for both the button and the arrow
buttonStyle
arrowStyle
commonStyle - styles to be applied to both the arrow and the button
$ npm install
$ npm run dev # to start webpack-dev-server
$ npm run serve # to start http-server on port 9091
now navigate to localhost:9091
See Roadmap
FAQs
A carefully crafted split-button for React
We found that react-split-button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.