Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Angular Tiny Slider


Hi, I would like to create a page that uses the Tiny Slider in Angular but I have not been able to find any reusable code. Has anyone already implemented this who is prepared to share example code?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (8)


I also want to create the same like page for our slough based company. cubic financial services - mortgage broker. you can visit our profile here to get the idea of our needs.



ECD Auto vehicles redefine what it means to drive a legend. Each build starts with an authentic Classic Defender, then undergoes a full transformation—blending vintage character with cutting-edge performance, technology, and luxury. Whether you're chasing off-road adventures or city style, these vehicles deliver unmatched presence and reliability. See the details and find your perfect Classic Defender, reimagined by ECD.



You can easily integrate Tiny Slider in Angular by creating a reusable component. If you need help, I can provide example code to get you started with the setup!
tag game



Perhaps you could take a look at this page for reference Chill Guy Clicker


Tiny Slider Integration in Angular

1. Install Tiny Slider

Run the following command to install Tiny Slider:

npm install tiny-slider --save

2. Create a Reusable Angular Component

Generate a new component:

ng generate component tiny-slider

3. Modify tiny-slider.component.ts

import { AfterViewInit, Component, ElementRef, Input, ViewChild } from '@angular/core';
import { tns } from 'tiny-slider/src/tiny-slider';

@Component({
 selector: 'app-tiny-slider',
 templateUrl: './tiny-slider.component.html',
 styleUrls: ['./tiny-slider.component.css']
})
export class TinySliderComponent implements AfterViewInit {
 @ViewChild('slider', { static: false }) slider!: ElementRef;
 @Input() options: any;

 ngAfterViewInit() {
 tns({
 container: this.slider.nativeElement,
 items: 1,
 slideBy: 'page',
 autoplay: true,
 ...this.options
 });
 }
}

4. Modify tiny-slider.component.html

<div #slider class="my-slider">
 <ng-content></ng-content>
</div>

5. Modify tiny-slider.component.css

.my-slider {
 display: flex;
 overflow: hidden;
}

.my-slider img {
 width: 100%;
}

6. Use the Component in Another Component

<app-tiny-slider [options]="sliderOptions">
 <div><img src="https://via.placeholder.com/800x400/ff7f7f/333333?text=Slide+1" alt="Slide 1"></div>
 <div><img src="https://via.placeholder.com/800x400/7f7fff/333333?text=Slide+2" alt="Slide 2"></div>
 <div><img src="https://via.placeholder.com/800x400/7fff7f/333333?text=Slide+3" alt="Slide 3"></div>
</app-tiny-slider>

7. Define Options in the Parent Component

sliderOptions = {
 items: 1,
 autoplay: true,
 controls: false,
 nav: true
};

Why Use This Approach

  • Reusable: You can use <app-tiny-slider> anywhere.
  • Customizable: Pass different options via [options].
  • Encapsulated: Styles and logic are contained within the component.
Play <a href="https://driftboss.site/" rel='dofllow'>drift boss</a>
<a href="https://eggy-car.site/" rel='dofllow'>Play Eggy Car</a>

Step 1: Install Tiny Slider
First, you need to install the Tiny Slider package. You can do this using npm:

npm install tiny-slider --save

Step 2: Create a Reusable Component
Create a new component for the slider. You can name it tiny-slider.
ng generate component tiny-slider
Step 3: Implement the Tiny Slider Component
In the tiny-slider.component.ts, import Tiny Slider and set it up:


import { Component, AfterViewInit, Input } from '@angular/core';
import { tns } from 'tiny-slider';

@Component({
selector: 'app-tiny-slider',
templateUrl: './tiny-slider.component.html',
styleUrls: ['./tiny-slider.component.css']
})
export class TinySliderComponent implements AfterViewInit {
@Input() items: string[] = [];

ngAfterViewInit() {
tns({
container: '.my-slider',
items: 1,
slideBy: 'page',
autoplay: true,
nav: true,
controls: true,
responsive: {
640: {
items: 1
},
768: {
items: 2
},
900: {
items: 3
}
}
});
}
}
Step 4: Create the Template
In the tiny-slider.component.html, set up the HTML structure for the slider:
<div class="my-slider">
<div *ngFor="let item of items" class="my-slider-item">
<img [src]="item" alt="Slider Image" />
</div>
</div>
Step 5: Add Styles
In the tiny-slider.component.css, you can add some basic styles for the slider:
.my-slider {
margin: 0 auto;
}

.my-slider-item {
text-align: center;
}

.my-slider-item img {
width: 100%;
border-radius: 8px;
}

Step 6: Use the Component
Now, you can use the TinySliderComponent in any of your Angular components. For example, in app.component.ts:
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
images = [
'
'
'
];
}

Step 7: Import Tiny Slider CSS
Finally, make sure to include Tiny Slider's CSS in your angular.json:
"styles": [
"src/styles.css",
"node_modules/tiny-slider/dist/tiny-slider.css"
],
@tap road



The platform is incredibly user-friendly, and it’s always a pleasure to log in and play. I found it through and loved how smooth the interface is. It makes exploring different games so easy, and I never run out of interesting slots to play. Perfect for anyone looking for a great time.



Hi Shane Fryer,

It seems we don’t have Tiny Slider implemented in the demo app. However, you can easily add it to your Angular project by installing it via npm.

Install using npm:

npm install tiny-slider --save


Import the Tiny Slider CSS file in your angular.json or SCSS file

@import "~tiny-slider/dist/tiny-slider.css";


Check here for more example:

https://github.com/ganlanyuan/tiny-slider


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(