0.1.3 • Published 6 months ago

@teenageinterface/carousel v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Carousel Component

The Carousel component allows you to create a sliding carousel with configurable options such as auto-sliding, controls, and dot indicators.

Installation

Ensure that you have installed the @teenageinterface/carousel library in your Angular project. If not, you can add it using:

npm install @teenageinterface/carousel

Usage

Import the Carousel component module into your Angular application:

import { CarouselComponent, SlideComponent } from '@teenageinterface/carousel';

@Component({
  selector: 'pages-carousel',
  template: `
    <tiCarousel [autoSlide]="true" [autoSlideTime]="3000">
      <tiSlide>Slide 1 Content</tiSlide>
      <tiSlide>Slide 2 Content</tiSlide>
      <tiSlide>Slide 3 Content</tiSlide>
    </tiCarousel>
  `,
})
export default class CarouselPage {}

Example

<tiCarousel [autoSlide]="true" [autoSlideTime]="3000">
  <tiSlide>Slide 1 Content</tiSlide>
  <tiSlide>Slide 2 Content</tiSlide>
  <tiSlide>Slide 3 Content</tiSlide>
</tiCarousel>

Properties

PropertyTypeDefaultDescription
autoSlideTimenumber3000Time in milliseconds between automatic slide transitions.
autoSlidebooleantrueEnables or disables auto-sliding.
dotbooleantrueControls whether dots (indicators) are displayed.
controlsbooleantrueControls whether the next/prev slide controls are displayed.
widthnumber320Sets the width of the carousel.
infinitebooleantrueEnables infinite scrolling of slides.
type"classic" | "modern""modern"Sets the type of carousel design. Can be either "classic" or "modern".

Methods

  • nextSlide(): Moves to the next slide.
  • prevSlide(): Moves to the previous slide.
  • goToSlide(index: number): Goes to a specific slide by index.
  • pauseAutoSlide(): Pauses the auto-slide feature.
  • resumeAutoSlide(): Resumes the auto-slide feature.

Events

  • onDragStart(event: MouseEvent): Triggered when the drag starts.
  • onDrag(event: MouseEvent): Triggered during the drag event.
  • onDragEnd(event: MouseEvent): Triggered when the drag ends.

Documentation

For more information, visit the official documentation.

License

This project is licensed under the MIT License.

0.1.3

6 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago