
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@mxck/pietile-carousel
Advanced tools
React carousel based on Framer Motion without repaints and simple in use.
Using yarn
yarn add pietile-carousel
or using npm
npm install -S pietile-carousel
Pietile Carousel depends on Framer Motion which is a peer dependency so be sure that it's installed in you project (if not then install it using yarn add framer-motion
or npm install -S framer-motion
)
Every item is wrapped in container where it can layout it's content. The size of container depends on the size of carousel and amount of visible items. You can use any styling system you want to set styles. Get ref and use moveLeft/moveRight/moveTo methods for scroll.
import React from 'react';
import { PietileCarousel } from 'pietile-carousel';
function App() {
const carouselStyle = {
width: 150,
height: 100,
};
const itemStyle = {
width: '100%',
height: '100%',
};
return (
<PietileCarousel style={carouselStyle}>
<div style={{ ...itemStyle, backgroundColor: 'red' }} />
<div style={{ ...itemStyle, backgroundColor: 'orange' }} />
<div style={{ ...itemStyle, backgroundColor: 'yellow' }} />
</PietileCarousel>
);
}
name | description | type | default |
---|---|---|---|
autoplayInterval | How often autoplay happens (0 to disable) | number | 0 |
children | Components rendered in carousel (required) | Node | - |
className | CSS class | string | - |
count | Amount of visible items | number | 1 |
draggable | Allow drag | boolean | true |
margin | Margin between items | number | 0 |
style | Style object | Object | - |
onChange | Callback when index changes | Function | - |
name | description |
---|---|
slideNext() | Scroll to next slide |
slidePrev() | Scroll to previous slide |
slideTo(index) | Scroll to index |
Carousel protects nesting links (a-tag's) from undesirable behavior (link click is being processed when the user starts dragging and release the mouse outside of the carousel) by calling preventDefault
for the correspondent click
event. If you are handling clicks manually you can check defaultPrevented when processing your event.
Pietile Carousel is MIT License.
FAQs
React Carousel
The npm package @mxck/pietile-carousel receives a total of 1 weekly downloads. As such, @mxck/pietile-carousel popularity was classified as not popular.
We found that @mxck/pietile-carousel 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
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.