
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-cardstack-fix
Advanced tools
Built for React, this component allows you to achieve a UI similar to the iOS passbook app.
react-cardstack requires React 15.3.0 or later.
npm install --save react-cardstack-fix
Live demo: cameronbourke.github.io/react-cardstack
To build the example locally, clone this repo then run:
npm install
npm start
Then open localhost:9000 in a browser.
React Card Stack exports an object with two components. These are CardStack and Card. The CardStack component is responsible for holding the state of it's child Card components. However, this is abstracted away which makes using the component a whole deal simpler. Note: there must be at least two instances of Card as children of CardStack, otherwise the component will throw an error.
An example use of React Card Stack looks like:
import { CardStack, Card } from 'react-cardstack';
<CardStack
height={500}
width={400}
background='#f8f8f8'
hoverOffset={25}>
<Card background='#2980B9'>
<h1>Number 1</h1>
</Card>
<Card background='#27AE60'>
<h1>Number 2</h1>
</Card>
</CardStack>
The Card component wraps around the content you want to render for each card. You can render both elements or components inside Card.
When all Card components are collapsed, the top of each card will be visible. This is basically the header of the Card component. To calculate what size the header will be simply divide the height passed to CardStack by the number of child Card components. In the example above, the header height for each card will be 500 / 2, which equals 250.
| Property | Type | Default | Description |
|---|---|---|---|
| width | number | 350px | the width of the component |
| height | number | 600px | the height of the component |
| background | string | f8f8f8 | can be a hex, rgba, gradiant value or a url() |
| hoverOffset | number | 30px | how far the card will shift up when being hovered |
| initialCard | number | -1 | if provided, the card at i'th index will be initially visible |
| style | number | {} | custom style for the cardStack |
| Property | Type | Default | Description |
|---|---|---|---|
| background | string | transparent | can be a hex, rgba, gradiant value or a url() |
| onCardClick | func | undefined | read below for description on how to use |
| style | number | {} | custom style for the card |
| buttonStyle | number | {} | custom style for the card button wrapper |
| cardSelectedStyle | number | {} | custom style for the card in selected state |
| cardHoverStyle | number | {} | custom style for the card in hover state |
onCardClick is a prop which can be passed to Card. It takes a function, acting as a callback, and will get invoked when a user clicks on the card in which you passed it to and it returns cardId, cardSelected, topOffset values. For example, look below:
<Card
background='#27AE60'
onCardClick={this.handleCardClick.bind(this)}>
<NumberTwo />
</Card>
// example of the function being bound
handleCardClick(cardId, cardSelected, topOffset) {
console.log(cardId, cardSelected, topOffset);
}
When this.handleCardClick is invoked, it will receive the parameter cardSelected which will be a boolean describing whether there is currently a card selected or not.
MIT Licensed Copyright (c) Cameron Bourke 2018
FAQs
react component inspired by the iOS passbook app UI
The npm package react-cardstack-fix receives a total of 0 weekly downloads. As such, react-cardstack-fix popularity was classified as not popular.
We found that react-cardstack-fix 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.