Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-card-carousel-prune
Advanced tools
A simple React carousel.
npm install react-card-carousel --save
Be sure to have all peer dependencies installed as well. React Card Carousel requires the peer dependencies below:
react
react-dom
prop-types
Import ReactCardCarousel and use it as a wrapper around card elements. Example:
import React, { Component } from 'react';
import ReactCardCarousel from 'react-card-carousel';
class MyCarousel extends Component {
static get CARD_STYLE() {
return {
height: '200px',
width: '200px',
paddingTop: '80px',
textAlign: 'center',
background: '#52C0F5',
color: '#FFF',
fontSize: '12px',
textTransform: 'uppercase',
borderRadius: '10px',
};
}
render() {
return (
<ReactCardCarousel autoplay={ true } autoplay_speed={ 2500 }>
<div style={ MyCarousel.CARD_STYLE }>
First Card
</div>
<div style={ MyCarousel.CARD_STYLE }>
Second Card
</div>
<div style={ MyCarousel.CARD_STYLE }>
Third Card
</div>
<div style={ MyCarousel.CARD_STYLE }>
Fourth Card
</div>
<div style={ MyCarousel.CARD_STYLE }>
Fifth Card
</div>
</ReactCardCarousel>
);
}
}
export default MyCarousel;
alignment
(String, oneOf[horizontal
, vertical
], default: horizontal
): Card alignment display.spread
(String, oneOf[narrow
, medium
, wide
], default: medium
): Spread between cards.initial_index
(Number, default: 0): Which card to display as center card initially.disable_keydown
(Boolean, default: false): Disables left and right arrow key scroll.disable_box_shadow
(Boolean, default: false): Disables box shadow around center card.disable_fade_in
(Boolean, default: false): Disables initial animation on component render.autoplay
(Boolean, default: false)autoplay_speed
(Number, default: 5000): Number in milliseconds.afterChange
(Function (cardIndex) => {}, default: null): After card change function.To use any instance methods, you must first create a ref to the ReactCardCarousel instance. Learn more about React refs in the official documentation.
<ReactCardCarousel ref={ Carousel => this.Carousel = Carousel }>
The methods can be accessed on the this.Carousel
instance:
this.Carousel.next()
: Sets next card as center card.this.Carousel.prev()
: Sets previous card as center card.this.Carousel.goTo(index)
: Sets the specified number index as center card.this.Carousel.getCurrentIndex()
: Gets current card index.NOTE: If you choose to create the ref using React.createRef() instead of using a callback ref, the methods can be accessed on the this.Carousel.current
instance.
Created by @strawbee at Tomorrow Ideas.
FAQs
Simple React carousel.
The npm package react-card-carousel-prune receives a total of 0 weekly downloads. As such, react-card-carousel-prune popularity was classified as not popular.
We found that react-card-carousel-prune 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.