UNPKG

mithril-materialized

Version:
39 lines (38 loc) 1.27 kB
import { FactoryComponent, Attributes } from 'mithril'; export interface CarouselItem extends Attributes { /** Relative page link, e.g. '#one' */ href: string; /** Image source */ src: string; /** Alternative name */ alt?: string; } export interface CarouselOptions { /** Duration of carousel item change animation in ms */ duration?: number; /** Zoom scale (perspective distance) */ dist?: number; /** Spacing for center image */ shift?: number; /** Padding between non-center items */ padding?: number; /** Number of visible items in carousel */ numVisible?: number; /** Change to full width styles */ fullWidth?: boolean; /** Toggle indicators */ indicators?: boolean; /** Don't wrap around and cycle through items */ noWrap?: boolean; } export interface CarouselAttrs extends CarouselOptions, Attributes { /** The list of images */ items: CarouselItem[]; /** Called when carousel item changes */ onCycleTo?: (item: CarouselItem, index: number, dragged: boolean) => void; } /** * Materialize CSS Carousel component with dynamic positioning * Port of the original MaterializeCSS carousel logic */ export declare const Carousel: FactoryComponent<CarouselAttrs>;