{"id":15282598,"url":"https://github.com/rkhayyat/nativescript-swipe-card","last_synced_at":"2025-09-04T10:39:16.169Z","repository":{"id":57308780,"uuid":"96050480","full_name":"rkhayyat/nativescript-swipe-card","owner":"rkhayyat","description":"Swipe Card plugin for nativescript","archived":false,"fork":false,"pushed_at":"2017-11-08T14:20:39.000Z","size":3078,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T22:29:19.370Z","etag":null,"topics":["angular","nativescript","plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkhayyat.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":"2017-07-02T21:41:12.000Z","updated_at":"2024-05-30T16:03:05.000Z","dependencies_parsed_at":"2022-08-29T12:51:00.696Z","dependency_job_id":null,"html_url":"https://github.com/rkhayyat/nativescript-swipe-card","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rkhayyat/nativescript-swipe-card","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkhayyat%2Fnativescript-swipe-card","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkhayyat%2Fnativescript-swipe-card/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkhayyat%2Fnativescript-swipe-card/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkhayyat%2Fnativescript-swipe-card/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkhayyat","download_url":"https://codeload.github.com/rkhayyat/nativescript-swipe-card/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkhayyat%2Fnativescript-swipe-card/sbom","scorecard":{"id":778243,"data":{"date":"2025-08-11","repo":{"name":"github.com/rkhayyat/nativescript-swipe-card","commit":"da8d35650ba8e4a7b7785a6cab40718def6973ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T04:12:05.484Z","repository_id":57308780,"created_at":"2025-08-23T04:12:05.484Z","updated_at":"2025-08-23T04:12:05.484Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273594987,"owners_count":25134256,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["angular","nativescript","plugin"],"created_at":"2024-09-30T14:31:29.937Z","updated_at":"2025-09-04T10:39:16.139Z","avatar_url":"https://github.com/rkhayyat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/nativescript-swipe-card.svg)](https://www.npmjs.com/package/nativescript-swipe-card)\n[![npm](https://img.shields.io/npm/dt/nativescript-swipe-card.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-swipe-card)\n[![twitter: @rakhayyat](https://img.shields.io/badge/twitter-%40rakhayyat-2F98C1.svg)](https://twitter.com/rakhayyat)\n\n[![NPM](https://nodei.co/npm/nativescript-swipe-card.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/nativescript-swipe-card/)\n\n# Nativescript Swipe Card plugin\nThis plugin is inspired by https://www.nativescript.org/blog/tinder-style-cards-with-nativescript---love-at-first-swipe\n\n# Nativescript-swipe-card\n\nTender cards, allow you to drag them, and detect swipe events. \n\nDeveloped with :heart: by the team [NativeBaguette 🥖](https://www.nativescript.org/blog/meet-the-nativescript-ambassadors)\n\nTo know more about the {N} ambassador's program, you can check this [video](https://www.youtube.com/watch?v=Of-EeB56Fuc\u0026t=4s), or read this [article](https://www.nativescript.org/blog/building-the-nativescript-swipe-cards-plugins-an-ambassador-story). \n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/rkhayyat/nativescript-swipe-card/blob/master/screenshot/swipeCard.gif\" width=\"300\"/\u003e\n\u003c/p\u003e\n\n## Installation\n\n```javascript\ntns plugin add nativescript-swipe-card\n```\n\n## Usage \n\n## Typescript NativeScript\n\n### XML\n  \n```xml\n\u003cPage xmlns=\"http://schemas.nativescript.org/tns.xsd\" \n      xmlns:customControls=\"nativescript-swipe-card\"\n      loaded=\"pageLoaded\" class=\"page\"\u003e\n    \u003cStackLayout\u003e\n        \u003ccustomControls:SwipeCard id=\"swipe\" \n                                  height=\"90%\"\n                                  width=\"80%\" \n                                  items=\"{{ stackCards }}\" \n                                  cardHeight=\"60\" \n                                  cardWidth=\"70\"\n                                  isRandomColor=\"1\"\n                                  cardBorderRadius=\"20\"\n                                  cardBorderWidth=\"2\"\n                                  /\u003e\n  \u003c/StackLayout\u003e\n\u003c/Page\u003e\n```\n### main-page\n\n```typescript\nimport * as observable from 'tns-core-modules/data/observable';\nimport * as pages from 'tns-core-modules/ui/page';\nimport {HelloWorldModel} from './main-view-model';\nimport {SwipeEvent} from 'nativescript-swipe-card';\n\n// Event handler for Page 'loaded' event attached in main-page.xml\nexport function pageLoaded(args: observable.EventData) {\n    // Get the event sender\n    let page = \u003cpages.Page\u003eargs.object;\n    page.bindingContext = new HelloWorldModel();\n    let swipeCard = page.getViewById(\"swipe\");\n    swipeCard.on(\"swipeEvent\", (args:SwipeEvent) =\u003e {\n        if (args.direction === 1) {\n                    //right\n                    console.log('Swiped to right');\n        } else {\n                    //left\n                    console.log('Swiped to left');\n        }\n    });\n}\n```\n### main-view-model\n```typescript\nimport {Observable} from 'tns-core-modules/data/observable';\nimport {Layout} from \"tns-core-modules/ui/layouts/layout\";\nimport {StackLayout} from \"tns-core-modules/ui/layouts/stack-layout\";\nimport {GridLayout, ItemSpec} from \"tns-core-modules/ui/layouts/grid-layout\";\nimport {Label} from \"tns-core-modules/ui/label\";\nimport {Image} from \"tns-core-modules/ui/image\";\nimport {Button} from \"tns-core-modules/ui/button\";\n\nexport class HelloWorldModel extends Observable {\n  public stackCards:Layout[];\n\n  constructor() {\n    super();\n\n    let Grid = new GridLayout();\n    let Label1 = new Label();\n    let Label2 = new Label();\n    Label1.text = \"The Swipable Card plugin\";\n    Label1.textWrap=true;\n    Label2.text = \"Welcome to {N} we present you\";\n    Label2.textWrap=true;\n    Grid.addChild(Label1);\n    Grid.addChild(Label2);\n    // Star and Auto modes for rows behave like corresponding setting for columns but refer to row height.\n    var firstRow = new ItemSpec(1, \"auto\");\n    var secondRow = new ItemSpec(1, \"auto\");\n    Grid.addRow(firstRow);\n    Grid.addRow(secondRow);\n    GridLayout.setRow(Label1,0);\n    GridLayout.setRow(Label2,1);\n\n\n    let stack2 = new StackLayout();\n    let image = new Image();\n    image.src=\"~/images/apple.jpg\"\n    image.height=100;\n    image.width=100;\n    stack2.verticalAlignment = \"middle\";\n    stack2.addChild(image);\n    \n\n    let stack3 = new StackLayout();\n    let button = new Button();\n    button.text=\"Click me!\";\n    button.width=100;\n    button.textAlignment = \"center\";\n    stack3.verticalAlignment = \"middle\";\n    stack3.addChild(button);\n    this.stackCards = [stack3,stack2,Grid];\n  }\n  \n}\n```\nFun fact! Team Time-Travel (Luna Kang, Stefan Medjo and mentor Jen Looper used the plugin to complete their 'Fetching' app - a Tinder app for dogs that uses the Petfinder API to help dogs to find puppy playdates in their area!\nhttps://github.com/jlooper/fetching-app-vanilla\n\n## Angular NativeScript\n\n### XML\n```xml\n        \u003cSwipeCard  height=\"75%\"\n                    width=\"100%\" \n                    [items]=\"stackCards\"\n                    (swipeEvent)=\"swipeEvent($event)\"\n                    cardHeight=\"50\" \n                    cardWidth=\"80\"\n                    isRandomColor=\"1\"\n                    cardBorderRadius=\"15\"\n                    cardBorderWidth=\"1\"\u003e\n        \u003c/SwipeCard\u003e \n```\n### Component\n```typescript\nelementRegistryModule.registerElement(\"SwipeCard\", () =\u003e require(\"nativescript-swipe-card\").SwipeCard);\nimport {SwipeEvent} from 'nativescript-swipe-card';\nimport {Layout} from \"tns-core-modules/ui/layouts/layout\";\nimport {StackLayout} from \"tns-core-modules/ui/layouts/stack-layout\";\nimport {GridLayout, ItemSpec} from \"tns-core-modules/ui/layouts/grid-layout\";\nimport {Label} from \"tns-core-modules/ui/label\";\nimport {Image} from \"tns-core-modules/ui/image\";\nimport {Button} from \"tns-core-modules/ui/button\";\nimport * as elementRegistryModule from 'nativescript-angular/element-registry';\n\n@Component({\n    moduleId: module.id,\n    templateUrl: \"helloworld.html\"\n})\nexport class helloworldComponent {\n\n  public stackCards:Array\u003cLayout\u003e=[];\n  \n  constructor(swipeEvent: SwipeEvent) {\n    let Grid = new GridLayout();\n    let Label1 = new Label();\n    let Label2 = new Label();\n    Label1.text = \"The Swipable Card plugin\";\n    Label1.textWrap=true;\n    Label2.text = \"Welcome to {N} we present you\";\n    Label2.textWrap=true;\n    Grid.addChild(Label1);\n    Grid.addChild(Label2);\n    // Star and Auto modes for rows behave like corresponding setting for columns but refer to row height.\n    var firstRow = new ItemSpec(1, \"auto\");\n    var secondRow = new ItemSpec(1, \"auto\");\n    Grid.addRow(firstRow);\n    Grid.addRow(secondRow);\n    GridLayout.setRow(Label1,0);\n    GridLayout.setRow(Label2,1);\n\n    let stack2 = new StackLayout();\n    let image = new Image();\n    image.src=\"~/images/apple.jpg\"\n    image.height=100;\n    image.width=100;\n    stack2.verticalAlignment = \"middle\";\n    stack2.addChild(image);\n\n    let stack3 = new StackLayout();\n    let button = new Button();\n    button.text=\"Click me!\";\n    button.width=100;\n    button.textAlignment = \"center\";\n    stack3.verticalAlignment = \"middle\";\n    stack3.addChild(button);\n    this.stackCards = [stack3,stack2,Grid];\n  }\n  swipeEvent(args:SwipeEvent) {\n        if (args.direction === 1) {\n                    //right\n                    console.log('Swiped to right');\n        } else {\n                    //left\n                    console.log('Swiped to left');\n        }\n  };   \n}\n\n```\nPS: I used this plugin in other application built in \u003cb\u003eAngular\u003c/b\u003e, you can check it here:\nhttps://github.com/rkhayyat/SyrianForumFrance\n## API\n\n### Properties\n\n| Property | Type | Default | Description |\n| --- | --- | --- | --- |\n| `swipeEvent` | `function` | `SwipeEvent` | Callback called when the layout is swiped to the right or left and the swipe animation is done. Return args:SwipeEvent: \u003cbr /\u003e 1- direction (1 if right/2 if left), \u003cbr /\u003e 2- cardIndex contain the card index  |\n\n### Methods\n\n| Method | Return | Description |\n| --- | --- | --- |\n| `items` | `Array\u003cLayout\u003e` | Array of card's layout, in which we can define the content of each card. |\n| `cardHeight` (optional)| `number` | Card's height in percentage of their container's height. |\n| `cardWidth` (optional)| `number` | Card's width in percentage of their container's width. |\n| `cardBorderRadius` (optional)| `number` | Card's border radius. |\n| `cardBorderWidth` (optional)| `number` | Card's border's width. |\n| `isRandomColor` (optional)| `number` | 1: Set card's colors randomly \u0026  automatically.  \u003cbr\u003e 2: Set card's colors manually. \u003cbr\u003e Default is 1. |\n\n\n## NativeBaguette 🥖\n\n[\u003cimg alt=\"Jean-Baptiste Aniel\" src=\"https://avatars1.githubusercontent.com/u/9477179?v=3\u0026u=bb0e7ce0e5afcfb810e2741921d6e6012423b60f\u0026s=400\" width=\"117\"\u003e](https://github.com/rhanbIT) | [\u003cimg alt=\"Rachid Al Kayat\" src=\"https://avatars1.githubusercontent.com/u/10686043?v=3\u0026s=400\" width=\"117\"\u003e](https://github.com/rkhayyat) |[\u003cimg alt=\"triniwiz\" src=\"https://avatars1.githubusercontent.com/u/6695919?v=3\u0026s=400\" width=\"117\"\u003e](https://github.com/triniwiz) | [\u003cimg alt=\"BradMartin\" src=\"https://avatars1.githubusercontent.com/u/6006148?v=3\u0026s=400\" width=\"117\"\u003e](https://github.com/bradmartin) | [\u003cimg alt=\"JenLooper\" src=\"https://avatars1.githubusercontent.com/u/1450004?v=3\u0026s=400\" width=\"117\"\u003e](https://github.com/jlooper) |\n:---: |:---: |:---: |:---: |:---: |\n[rhanb](https://github.com/rhanbIT) | [rkhayyat](https://github.com/rkhayyat)  |[triniwiz](https://github.com/triniwiz) |[bradmartin](https://github.com/bradmartin) |[jlooper](https://github.com/jlooper) |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkhayyat%2Fnativescript-swipe-card","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkhayyat%2Fnativescript-swipe-card","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkhayyat%2Fnativescript-swipe-card/lists"}