New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tmaito-carousel

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmaito-carousel

react component carousel

  • 1.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

npm

npm install tmaito-carousel --save

yarn

yarn add tmaito-carousel
  • Also install tmaito-carousel for css
import "tmaito-carousel/libs/index.css";

Example

import React, { Component } from 'react';
import Carousel from 'tmaito-carousel'
import 'tmaito-carousel/libs/index.css';

const { item } = Carousel;

class CarouselDemo extends Component {
  render() {
    return (
      <div className="examples">
        <Carousel height={200} type="card" autoplay={false}>
          {[1, 2, 3, 4].map(item => (
            <Item key={item}>{item}</Item>
          ))}
        </Carousel>
      </div>
    );
  }
}
export default CarouselDemo;
参数说明类型可选值默认值
height走马灯的高度number200
initialIndex初始状态激活的幻灯片的索引,从 0 开始number0
trigger指示器的触发方式stringclick/hoverhover
autoplay是否自动切换booleantrue
interval自动切换的时间间隔,单位为毫秒number35000
dotPosition面板指示点的位置stringoutside top bottom left right
dots是否显示面板指示点booleanfalsetrue
arrow切换箭头的显示时机stringalways/hover/neverhover
type走马灯的类型stringcard
activeCardScale主卡片宽度比例,走马灯的类型为card时生效number0 - 10.6
事件名称说明回调参数
onChange幻灯片切换时触发,目前激活的幻灯片的索引,上一面板 or 下一面板(activeIndex, isNext)
方法名说明参数
setActiveItem切换到指定面板需要切换的幻灯片的索引,从 0 开始
prev切换至上一面板
next切换至下一面板

Keywords

FAQs

Package last updated on 03 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc