{"id":15367211,"url":"https://github.com/arfedulov/vue-carousel-generic","last_synced_at":"2026-05-02T09:32:24.167Z","repository":{"id":57394863,"uuid":"300054686","full_name":"arfedulov/vue-carousel-generic","owner":"arfedulov","description":"Generic vue carousel component which makes minimum assumptions on appearance. It just provides the core carousel functionality.","archived":false,"fork":false,"pushed_at":"2021-09-28T12:14:39.000Z","size":287,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T15:57:37.473Z","etag":null,"topics":["carousel","vue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/arfedulov.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":"2020-09-30T20:31:48.000Z","updated_at":"2024-03-11T18:41:25.000Z","dependencies_parsed_at":"2022-09-06T04:01:26.919Z","dependency_job_id":null,"html_url":"https://github.com/arfedulov/vue-carousel-generic","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/arfedulov%2Fvue-carousel-generic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arfedulov%2Fvue-carousel-generic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arfedulov%2Fvue-carousel-generic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arfedulov%2Fvue-carousel-generic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arfedulov","download_url":"https://codeload.github.com/arfedulov/vue-carousel-generic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245926549,"owners_count":20695070,"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":["carousel","vue"],"created_at":"2024-10-01T13:23:32.085Z","updated_at":"2026-05-02T09:32:24.128Z","avatar_url":"https://github.com/arfedulov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-carousel-generic\n\nGeneric vue carousel component which makes minimum assumptions on appearance. It just provides the core carousel functionality.\n\n## Installation:\n\n```\nnpm i vue-carousel-generic\n```\n\n## Usage example:\n\n```html\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003ch1\u003eExample\u003c/h1\u003e\n    \u003cvue-carousel\n      class=\"carousel\"\n      :items=\"items\"\n      :current-item=\"current\"\n      :visible-at-a-time=\"[1]\"\n      :speed=\"1\"\n      @carousel-move=\"updateCurrentItem\"\n    \u003e\n      \u003ctemplate v-slot:item=\"{ item }\"\u003e\n        \u003cdiv class=\"carousel__item\"\u003e{{ item }}\u003c/div\u003e\n      \u003c/template\u003e\n    \u003c/vue-carousel\u003e\n    \u003cbutton @click=\"updateCurrentItem(-1)\"\u003e\u0026langle;\u003c/button\u003e\n    \u003cbutton @click=\"updateCurrentItem(1)\"\u003e\u0026rangle;\u003c/button\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueCarousel from \"vue-carousel-generic\";\n\nexport default {\n  components: { VueCarousel },\n  data() {\n    return {\n      items: [\n        \"0\",\n        \"1\",\n        \"2\",\n        \"3\",\n        \"4\",\n        \"5\",\n        \"6\",\n        \"7\",\n        \"8\",\n        \"9\",\n        \"10\",\n        \"11\",\n        \"12\"\n      ],\n      current: 0\n    };\n  },\n  methods: {\n    updateCurrentItem(dir) {\n      const newPos = this.current + dir;\n\n      if (dir \u003c 0) {\n        this.current = newPos \u003e= 0 ? newPos : 0;\n\n        return;\n      }\n\n      this.current =\n        newPos \u003c this.items.length ? newPos : this.items.length - 1;\n    }\n  }\n};\n\u003c/script\u003e\n```\n\n## Props\n\n- `items` - **required** - a list of elements to fill a carousel with;\n- `current-item` - **required** the position number of the currently displayed item\n (in case more than one item is visible at a time, `currentNumber` represents\n the position number of the first of visible elements);\n- `visible-at-aTime` - **default:** `[1]` - a list of numbers which represent element's fractions displayed\n in carousel in one slide (e.g. `[0.5, 1, 0.5]` means that on each slide there is half\n of the first element, full second element, half of the third element).\n- `step` - **default:** `1` - carousel step;\n- `speed` - **default:** `1` - the speed of the carousel;\n- `swipe-threshold` - **default:** `20` - the threshold in `px` for swipe events to fire;\n- `swipe-timeout` - **default:** `500` - the maximum length in `ms` of a single swipe;\n- `touch-only-swipes` - **default:** `false` - if `true`, swipe events will only fire on\n touch devices\n- `swipeTimingFunction` - **default:** `ease-out` - css timing function for swipe transition\n \n ## Slots\n \n - `item` - a single element in carousel (slot props: `{ item: any }`)\n\n## Events\n\n- `carousel-move` - Payload: `number` - an index offset (negative for moving backwards);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farfedulov%2Fvue-carousel-generic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farfedulov%2Fvue-carousel-generic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farfedulov%2Fvue-carousel-generic/lists"}