{"id":13808246,"url":"https://github.com/Jaspero/ng-slider","last_synced_at":"2025-05-14T02:31:34.174Z","repository":{"id":33788559,"uuid":"157400519","full_name":"Jaspero/ng-slider","owner":"Jaspero","description":"A light slider with no external dependencies","archived":false,"fork":false,"pushed_at":"2024-07-26T11:41:11.000Z","size":4575,"stargazers_count":5,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-04T07:05:13.832Z","etag":null,"topics":["angular","slider"],"latest_commit_sha":null,"homepage":null,"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/Jaspero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Jaspero"]}},"created_at":"2018-11-13T15:17:26.000Z","updated_at":"2024-07-26T11:41:13.000Z","dependencies_parsed_at":"2024-07-26T12:12:17.381Z","dependency_job_id":null,"html_url":"https://github.com/Jaspero/ng-slider","commit_stats":{"total_commits":130,"total_committers":7,"mean_commits":"18.571428571428573","dds":0.6307692307692307,"last_synced_commit":"7cf825cab47e2ddd4ffc09f43d47647b31f9d203"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaspero%2Fng-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaspero%2Fng-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaspero%2Fng-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaspero%2Fng-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaspero","download_url":"https://codeload.github.com/Jaspero/ng-slider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224937283,"owners_count":17395121,"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":["angular","slider"],"created_at":"2024-08-04T01:01:38.256Z","updated_at":"2024-11-19T00:30:39.686Z","avatar_url":"https://github.com/Jaspero.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Jaspero"],"categories":["Table of contents"],"sub_categories":["Third Party Components"],"readme":"[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\r\n![Build](https://github.com/Jaspero/ng-slider/workflows/Build/badge.svg)\r\n[![NPM Version](https://img.shields.io/npm/v/@jaspero/ng-slider.svg)](https://www.npmjs.com/package/@jaspero/ng-slider)\r\n\r\n# NG Slider\r\n\r\nA slider library for Angular\r\n\r\n## Installation\r\n\r\nTo install this library, run:\r\n\r\n```bash\r\n$ npm install --save @jaspero/ng-slider\r\n```\r\n\r\n## Setup\r\n\r\nImport `JpSliderModule` in to your `@NgModule`:\r\n\r\n```ts\r\n@NgModule({\r\n    imports: [\r\n        JpSliderModule\r\n    ],\r\n    ...\r\n})\r\nexport class AppModule {}\r\n```\r\n\r\nYou can also provide default slider [configuration options](#options)\r\nwhen importing the module\r\n\r\n```ts\r\n@NgModule({\r\n    imports: [\r\n        JpSliderModule.defaultOptions(options)\r\n    ],\r\n    ...\r\n})\r\n```\r\n\r\nNow you can use the slider in your components like this:\r\n\r\n```html\r\n\u003cjp-slider [options]=\"options\"\u003e\r\n  \u003cjp-slides\u003e\r\n    \u003cjp-slide\u003e\r\n      \u003ch1\u003eSlide 1\u003c/h1\u003e\r\n      \u003cp\u003eContent 1\u003c/p\u003e\r\n    \u003c/jp-slide\u003e\r\n    \u003cjp-slide\u003e\r\n      \u003ch1\u003eSlide 2\u003c/h1\u003e\r\n      \u003cp\u003eContent 2\u003c/p\u003e\r\n    \u003c/jp-slide\u003e\r\n  \u003c/jp-slides\u003e\r\n  \u003cjp-slide-pagination\u003e\u003c/jp-slide-pagination\u003e\r\n  \u003cbutton jpSlideArrow=\"left\"\u003eLeft\u003c/button\u003e\r\n  \u003cbutton jpSlideArrow=\"right\"\u003eRight\u003c/button\u003e\r\n\u003c/jp-slider\u003e\r\n```\r\n\r\n## Configuration\r\n\r\n### Options\r\n\r\nYou can provide default global options when importing the slider module `JpSliderModule.defaultOptions(options)`\r\nor on the `jp-slider` component `\u003cjp-slider [options]=\"options\"\u003e`. Options provided through the component\r\ninput are merged with default options with component options overriding the default ones.\r\n\r\n| name                  | type    | default | description                                                                                  |\r\n| --------------------- | ------- | ------- | -------------------------------------------------------------------------------------------- |\r\n| blocksPerView         | number  | 1       | how many slides should be shown per view                                                     |\r\n| slideTime             | number  | 0       | on what interval should the slider auto slide (disabled if 0)                                |\r\n| movesPerClick         | number  | 1       | how many slides should be moved per click on the jpSlideArrow directive                      |\r\n| initialSlide          | number  | 0       | index of the first slide that should be in view when the component inits                     |\r\n| loop                  | boolean | true    | should the slider loop (clicking on the last slide takes you to the first one and vice versa |\r\n| firstToLastTransition | boolean | false   | animate transition between first and last slide (performance intensive)                      |\r\n\r\n### Events\r\n\r\n### Customization\r\n\r\nThe library ships with bare minimum styles. This is all there is to it:\r\n\r\n```scss\r\n// jp-slider component\r\n:host {\r\n  display: block;\r\n  height: 100%;\r\n  width: 100%;\r\n}\r\n\r\n.jp-s-w {\r\n  position: relative;\r\n  overflow: hidden;\r\n  height: 100%;\r\n  width: 100%;\r\n}\r\n\r\n.jp-s-w-i {\r\n  position: relative;\r\n  height: 100%;\r\n  display: flex;\r\n  transition: 0s;\r\n  \u0026.active {\r\n    transition: 0.3s;\r\n  }\r\n}\r\n```\r\n\r\nThis is to allow for all kinds of customizations, with the downside being\r\nthat no styles are provided out of the box.\r\n\r\n## Caveats\r\n\r\n- If hammer is enabled and you need click events in a slide use `(tap)` instead of `(click)`.\r\n  Hammer has a bug where it registers the click event after pan ends, there are a lot of issues\r\n  documenting this behaviour, here is one example:\r\n  https://github.com/hammerjs/hammer.js/issues/815\r\n\r\n## License\r\n\r\nMIT © [Jaspero co.](mailto:info@jaspero.co)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaspero%2Fng-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJaspero%2Fng-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaspero%2Fng-slider/lists"}