{"id":13606197,"url":"https://github.com/yoloten/react-stack-cards","last_synced_at":"2025-04-12T08:30:37.038Z","repository":{"id":34984401,"uuid":"191037624","full_name":"yoloten/react-stack-cards","owner":"yoloten","description":"Visit the demo page","archived":false,"fork":false,"pushed_at":"2022-12-10T18:37:42.000Z","size":22459,"stargazers_count":48,"open_issues_count":27,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T17:46:03.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://yoloten.github.io/react-stack-cards/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoloten.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-09T17:49:07.000Z","updated_at":"2024-12-25T01:45:03.000Z","dependencies_parsed_at":"2023-01-15T11:30:46.045Z","dependency_job_id":null,"html_url":"https://github.com/yoloten/react-stack-cards","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoloten%2Freact-stack-cards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoloten%2Freact-stack-cards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoloten%2Freact-stack-cards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoloten%2Freact-stack-cards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoloten","download_url":"https://codeload.github.com/yoloten/react-stack-cards/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248539750,"owners_count":21121228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:06.982Z","updated_at":"2025-04-12T08:30:32.029Z","avatar_url":"https://github.com/yoloten.png","language":"TypeScript","readme":"# React-Stack-Cards\n\nCollection of stack card effects exclusively for React that's perfect for galleries and preview grids. Inspired by ideas from tympanus.net. \nSee the demo https://yoloten.github.io/react-stack-cards/\n\nFeautures: \n\n- Animations on hover, swipe and toggle\n- Swipe animations allow you to work with big amount of images and colors\n- Flexible settings like adding elements into the cards, change duration of animation and etc.\n- Effects actually look awesome :blush:\n- Supports Typescript\n\nAvailable components:\n\n- `ToggleCard`\n- `TinderLikeCard`\n- `StackCard`\n\n## Installation\n\nYou can install react-stack-cards from npm\n\n```\nnpm i -S react-stack-cards\n```\nOr use yarn\n\n```\nyarn add react-stack-cards\n```\n\n## Simple usage\n\n```javascript\nimport { ToggleCard, TinderLikeCard, StackCard } from 'react-stack-cards'\n\nclass Example extends React.Component {\n  constructor(props){\n    super(props)\n    this.state = {\n      directionTinder: \"swipeCornerDownRight\",\n      directionToggle: \"sideSlide\",\n      directionStack: \"topRight\",\n      isOpen: false\n    }\n    this.Tinder = null\n  }\n  \n  onTinderSwipe() {\n    this.Tinder.swipe()\n  }\n  onToggle() {\n    this.setState({isOpen: !this.state.isOpen})\n  }\n\n  render() {\n    const arr = [\"first\", \"second\", \"third\", \"fourth\"]\n    const numbers = [0, 1, 2, 3]\n    return (\n      \u003cdiv\u003e\n        \u003cToggleCard \n          images={arr}\n          width=\"350\"\n          height=\"240\"\n          direction={this.state.directionToggle}\n          duration={400}\n          className=\"toggle\"\n          isOpen={this.state.isOpen}\n          onClick={()=\u003e alert(\"Hello\")}\n        \u003e\n        { numbers.map( i =\u003e \u003cdiv\u003e{i}\u003c/div\u003e )}\n        \u003c/ToggleCard\u003e\n        \u003cbutton onClick={this.onToggle.bind(this)}\u003eToggle\u003c/button\u003e\n\n        \u003cTinderLikeCard\n            images={arr}\n            width=\"350\"\n            height=\"250\"\n            direction={this.state.directionTinder}\n            duration={400}\n            ref={(node) =\u003e this.Tinder = node}\n            className=\"tinder\"\n        \u003e\n            { numbers.map( i =\u003e \u003cdiv\u003e{i}\u003c/div\u003e )}\n        \u003c/TinderLikeCard\u003e\n        \u003cbutton onClick={this.onTinderSwipe.bind(this)}\u003eSwipe\u003c/button\u003e\n\n        \u003cStackCard\n          images={arr}\n          color={\"#f95c5c\"}\n          width=\"350\"\n          height=\"240\"\n          direction={this.state.directionStack}\n          onClick={()=\u003e alert(\"Hello\")}\n        \u003e\n          \u003cdiv\u003ei\u003c/div\u003e\n        \u003c/StackCard\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\n```\n## Props\nCommon props for all three components:\n\n- `children` - allows to add children elements (React.Element)\n- `className` - apply a className to the control (string)\n- `direction` - select animation type (string)\n- `duration` - set duration of animation (number)\n- `images` - array of images to set on the background (array of strings)\n- `height` - height of the card (string)\n- `width` - width of the card (string)\n\n`children` prop can be an array of the elements or single element in `TinderLikeCard` and `ToggleCard`. `StackCard` only supports one element.\n\nSpecial props for `TinderLikeCard`:\n\n- `colors` - array of colors to set on the background (array of strings)\n\nSpecial props for `ToggleCard`:\n\n- `colors` - array of colors to set on the background (array of strings)\n- `onMouseEnter` - occurs when the mouse pointer is moved onto an element\n- `onMouseLeave` - occurs when the mouse pointer is moved out of an element\n- `onClick` - occurs when the user clicks on an element\n- `isOpen` - allows you to animate component (boolean)\n\nSpecial props for `StackCard`:\n- `color` - color to set on the background (string)\n- `onMouseEnter` - occurs when the mouse pointer is moved onto an element\n- `onMouseLeave` - occurs when the mouse pointer is moved out of an element\n- `onClick` - occurs when the user clicks on an element\n\n## Methods\n- `swipe()` - swipe method for TinderLikeCard\n\n## License\nMIT Licensed. Copyright (c) 2019 yoloten\n","funding_links":[],"categories":["UI Frameworks"],"sub_categories":["Component Collections"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoloten%2Freact-stack-cards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoloten%2Freact-stack-cards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoloten%2Freact-stack-cards/lists"}