@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Simple horizontal scroll strategy.

    Items are laid out in a horizontal row and translated so the active item is centred. Only the active item and its immediate neighbours are fully opaque; the rest fade out.

    readonly strategy = new ScrollCarouselStrategy();
    

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Parameters

      • Optionaloptions: { fade?: boolean; gap?: number; itemWidth?: number }

      Returns ScrollCarouselStrategy

    Properties

    name: "scroll"

    Human-readable name (useful for debugging / stories).

    Methods

    • Compute the CSS styles for a single item.

      Parameters

      • itemIndex: number

        — the item's position in the array

      • activeIndex: number

        — the currently centred / active index

      • totalItems: number

        — total number of items

      • wrap: boolean = false

      Returns CarouselItemStyle

    • Returns the CSS style object for the track container itself. Strategies may set perspective, overflow, etc.

      Returns Record<string, string>