Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-carousel-slider
Advanced tools
A React component that endeavors to provide flexbility for customizing carousel/slider.
##Features :
<a></a>
, <Link></Link>
for your own.##Playground
Install it from npm.
npm install react-carousel-slider
As ES module:
import CarouselSlider from "react-carousel-slider"
As CommonJS module:
var CarouselSlider = require("react-carousel-slider")
The UMD build:
<script src="https://unpkg.com/react-carousel-slider/umd/react-carousel-slider.js"></script>
carr1005.github.io/react-carousel-slider/index.html
This component would register touch events automaically where mobile device veiwport is detected, so the drag event is also available on mobile.
We could render a component with the slideItems
prop which accepts an array of objects with the specific simple sturcture and keys in default style.
import React, {Component} from 'react'
import CarouselSlider from 'react-carousel-slider';
class App extends Component {
render() {
let data = [
{
des: "1",
imgSrc: "https://i.imqur.com/yourImage.jpg"
},
{
des: "2",
imgSrc: "https://i.imqur.com/yourImage2.jpg"
}
];
return <CarouselSlider slideItems = {data} />;
}
}
Or give an array of your own regular React elements to slideCpnts
prop, this lets our slide have availability to contain a clickable link. Even cooperating with <Link>
component of React Router library for client side routing is possible.
import React, {Component} from 'react'
import CarouselSlider from 'react-carousel-slider';
import {BrowserRouter as Router, Link } from 'react-router-dom';
class App extends Component {
render() {
let jsonData = require('./slidesExample.json');
/*
{
"items": [
{
"des": "1",
"imgSrc": "https://i.imqur.com/yourImage.jpg"
},
{
"des": "2",
"imgSrc": "https://i.imqur.com/yourImage2.jpg"
}
]
}
*/
let items = jsonData.items.map((item, index) =>
<Link to = {'/' + item.des} >
<img src = {item.imgSrc} ></img>
<p>{item.des}</p>
</Link>
);
return (<Router>
<CarouselSlider slideCpnts = {items} />
</Router>);
}
}
[
{
des: "1",
imgSrc: "https://i.imqur.com/yourImage.jpg"
},
{
des: "2",
imgSrc: "https://i.imqur.com/yourImage2.jpg"
}
]
slidesCpnts
- accepts an array of regular React elements, the <img></img>
element and available image source are required, we have the default style for <p>
block, override it by specifying your own with using inline-styles. let textBoxStyle = {
width: "50%",
background: "transparent",
textAlign: "right",
color: "black"
};
let items = jsonData.items.map((item, index) =>
<div>
<img src = {item.imgSrc} ></img>
<p style = {textBoxStyle} >{item.des}</p>
</div>
);
All props below are optional, default setting is applied if we don't specify ours.
manner
buttonSetting
lBtnCpnt
rBtnCpnt
sliderBoxStyle
itemsStyle
textBoxStyle
FAQs
react-carousel-slider React component
The npm package react-carousel-slider receives a total of 310 weekly downloads. As such, react-carousel-slider popularity was classified as not popular.
We found that react-carousel-slider 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.