Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
react-crouton
Advanced tools
A message component for reactjs
Install via npm
npm i react-crouton --save-dev
var Crouton = require('react-crouton')
var data = {
id: Date.now(),
type: 'error',
message: 'Hello React-Crouton',
autoMiss: true || false,
onDismiss: listener,
buttons: [{
name: 'close',
listener: function() {
}
}],
hidden: false,
timeout: 2000
}
<Crouton
id={data.id}
type={data.type}
message={data.message}
onDismiss={data.onDismiss}
buttons={data.buttons}
hidden={data.hidden}
timeout={data.timeout}
autoMiss={data.autoMiss}/>
id required, every message need an unique id.
type: number
message required, the message what you want show.
type: string
|| array
example:
message: 'Hello React-Crouton'
message: ['Hello', 'React', '-', 'Crouton']
type required, define what type message you want to define.
type: string
hidden optional, control this property to show or hidden crouton.
type: boolean
, default is false
buttons optional, define the buttons that you want show to the user.
type: string
|| array
example:
buttons: 'close'
butons: [{
name: 'close'
}]
butons: [{
name: 'close',
listener: function() {
console.log('close button clicked.')
}
}]
autoMiss optional, crouton will auto missed if set this propterty, default is true.
type: boolean
timeout optional, set how long (ms) to auto dismiss the crouton.
type: number
, default is 2000
ms (2 seconds)
onDismiss optional, crouton will invoke this listener when it dismissed.
type: function
MIT
FAQs
A message component for reactjs.
The npm package react-crouton receives a total of 1,029 weekly downloads. As such, react-crouton popularity was classified as popular.
We found that react-crouton 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.