Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joshdsommer/nativescript-ngx-slides

A NativeScript + Angular module for to add a slides component to your mobile app
https://github.com/joshdsommer/nativescript-ngx-slides

angular image-carousel nativescript-plugin nativescript-slides slide slider-plugin

Last synced: 14 days ago
JSON representation

A NativeScript + Angular module for to add a slides component to your mobile app

Awesome Lists containing this project

README

        

# NativeScript + Angular Slides for iOS and Android

[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![Twitter Follow][twitter-image]][twitter-url]

[npm-image]: http://img.shields.io/npm/v/nativescript-ngx-slides.svg
[npm-url]: https://npmjs.org/package/nativescript-ngx-slides
[downloads-image]: http://img.shields.io/npm/dt/nativescript-ngx-slides.svg
[twitter-image]: https://img.shields.io/twitter/follow/_joshsommer.svg?style=social&label=Josh%20Sommer
[twitter-url]: https://twitter.com/_joshsommer

### Intro slides example:

[![Nativescript Slides. Click to Play](https://img.youtube.com/vi/kGby8qtSDjM/0.jpg)](https://www.youtube.com/embed/kGby8qtSDjM)

### Image carousel example:

[![Nativescript Slides. Click to Play](https://img.youtube.com/vi/RsEqGAKm62k/0.jpg)](https://www.youtube.com/embed/RsEqGAKm62k)

_videos are from the NativeScript Slides plugin. all features may not be implemented yet._

_videos by [Brad Martin](https://github.com/bradmartin)_

## Example Usage:

```ts
import { SlidesModule } from "nativescript-ngx-slides";

import { AppComponent } from "./app.component";

@NgModule({
declarations: [AppComponent],
bootstrap: [AppComponent],
imports: [NativeScriptModule, SlidesModule],
schemas: [NO_ERRORS_SCHEMA]
})
export class AppModule {}
```

### XML

```xml















```

### CSS

place this in the app.css file in the root of your project.

```css
.slide-1 {
background-color: darkslateblue;
}

.slide-2 {
background-color: darkcyan;
}
.slide-3 {
background-color: darkgreen;
}

.slide-4 {
background-color: darkgoldenrod;
}
.slide-5 {
background-color: darkslategray;
}
label {
text-align: center;
width: 100%;
font-size: 35;
margin-top: 35;
color: #fff;
}
```

Great for Intros/Tutorials to Image Carousels.

This very much a work in progress. Please feel free to contribute.

### Attributes for SlideContainer

- **loop : boolean** - If true will cause the slide to be an endless loop. The suggested use case would be for a Image Carousel or something of that nature.

- **pageIndicators : boolean** - If true adds indicator dots to the bottom of your slides.

- **swipeSpeed : number** - Determines the speed of swipe. The bigger `swipeSpeed` property is, the faster you swipe the slides. Default value is 3. Try changing it to 15 to see the result.

#### Indicators

If the property `pageIndicators` is `true` you won't see the page indicators anymore as of 2.0.0 right away. there are two css classes exposed that you can setup however you like for active and inactive indicators. below is an example for semi translucent dots.

```css
.slide-indicator-inactive {
background-color: #fff;
opacity: 0.4;
width: 10;
height: 10;
margin-left: 2.5;
margin-right: 2.5;
margin-top: 0;
border-radius: 5;
}

.slide-indicator-active {
background-color: #fff;
opacity: 0.9;
width: 10;
height: 10;
margin-left: 2.5;
margin-right: 2.5;
margin-top: 0;
border-radius: 5;
}
```

#### Plugin Development Work Flow:

- Clone repository to your machine.
- Run `npm install` to prepare the project
- Run and deploy to your device or emulator with `npm run android` or `npm run ios`
- Build a ngPackagr version with `npm run build`

#### Known issues

- Does not work well inside of ScrollView or TabViews.

## Contributors

| [TheOriginalJosh](https://github.com/TheOriginalJosh) | [dobjek](https://github.com/dobjek) | [EddyVerbruggen](https://github.com/EddyVerbruggen) | [Vahid Najafi](https://github.com/vahidvdn) | [Marco Mantovani](https://github.com/codeback) |
| :-------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: |
| [Josh Sommer](https://github.com/TheOriginalJosh) | [dobjek](https://github.com/dobjek) | [Eddy Verbruggen](https://github.com/EddyVerbruggen) | [Vahid Najafi](https://github.com/vahidvdn) | [Codeback Software](https://github.com/codeback) |

## Contributing guidelines

[Contributing guidelines](https://github.com/TheOriginalJosh/nativescript-swiss-army-knife/blob/master/CONTRIBUTING.md)

## License

[MIT](/LICENSE)

for {N} version 2.0.0+