
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
react-visjs-timeline
Advanced tools
React component for the vis.js timeline module.
npm install --save vis
npm install --save react-visjs-timeline
Note: Data passed to the component should be Immutable. If you are new to Immutable data Seamless Immutable and Immutable.js are good places to start.
import Timeline from 'react-visjs-timeline'
// http://visjs.org/docs/timeline/#Configuration_Options
const options = {
width: '100%',
height: '60px',
stack: false,
showMajorLabels: true,
showCurrentTime: true,
zoomMin: 1000000,
type: 'background',
format: {
minorLabels: {
minute: 'h:mma',
hour: 'ha'
}
}
}
// jsx
<Timeline options={options} />
Not all features from vis.js timeline are supported (Pull Requests are welcome). Because of React's declarative style, vis.js methods need abstracting via prop configuration (see customTimes for example) so some features are more tricky than others.
Items follow the exact same for format as they do in vis.js. See the vis.js documentation for more information.
const items = [{
start: new Date(2010, 7, 15),
end: new Date(2010, 8, 2), // end is optional
content: 'Trajectory A',
}]
<Timeline
options={options}
items={items}
/>
Groups follow the exact same for format as they do in vis.js. See the vis.js documentation for more information.
const groups = [{
id: 1,
content: 'Group A',
}]
<Timeline
options={options}
groups={groups}
/>
Custom Times are defined more declaritively in the component, via the customTimes prop. You define them via a simple object where the key is the id of the custom time and the value is the datetime:
const customTimes = {
one: new Date(),
two: 'Tue May 10 2016 16:17:44 GMT+1000 (AEST)'
}
When the customTimes prop changes, the updated times will be reflected in the timeline.
All events are supported via prop function handlers. The prop name follows the convention <eventName>Handler and the specified function will receive the same arguments as the vis.js counterparts.
Some visjs event names are not camelcased (e.g. rangechange), so the corresponding React prop names need to follow that convention where necessary:
<Timeline
options={options}
clickHandler={clickHandler}
rangechangeHandler={rangeChangeHandler}
/>
function clickHandler(props) {
// handle click event
}
function rangeChangeHandler(props) {
// handle range change
}
You can enable animation (when the options start/end values change) by passing a prop of animation to the component. The available options for this prop follow the same conventions as setWindow in vis.js. So you can either pass a boolean value (true by default) or an object specifying your animation configuration, e.g:
// animate prop...
{
duration: 3000,
easingFunction: 'easeInQuint',
}
Import your custom CSS after you import the component from the module, e.g:
import Timeline from 'react-visjs-timeline'
import './my-custom-css.css' // in conjunction with webpack's style-loader
FAQs
React component for the vis.js timeline module
The npm package react-visjs-timeline receives a total of 1,555 weekly downloads. As such, react-visjs-timeline popularity was classified as popular.
We found that react-visjs-timeline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.