Coder Social home page Coder Social logo

react-textscroll's Introduction

TextScroll

Build Status

基于React的文字滚动组件,具有多种展示模式以及参数定制,适用于消息广播、大屏展示等场景

Dev

yarn install

yarn test 

yarn start

ONLINE DISPLAY

TextScroll

HOW TO USE IT

垂直滚动

import React from 'react'
import TextScroll from 'react-textscroll'

class Content extends React.Component {
	render() {
    	const text = ['1. 第一条消息', '2. 第二条消息', '3. 第三条消息']
    	return (
        	<div>
            	<TextScroll 
                    mode='vertical'
                    text={text} 
                    speed={1000} 
                />
            </div>
        )
    }
}

水平滚动

import React from 'react'
import TextScroll from 'react-textscroll'

class Content extends React.Component {
	render() {
    	const text = ['这是一条很长很长的消息,可以由多条组成。今天天气晴,微风,空气质量好,紫外线强']
    	return (
        	<div>
            	<TextScroll 
                    mode='horizontal'
                    text={text} 
                    speed={1000} 
                />
            </div>
        )
    }
}

API

参数 说明 类型 默认值
mode 文字滚动类型,目前支持水平、垂直 string: horizontal vertical vertical
text 要展示的长文字/文字数组 string[] -
speed 滚动速度 number 5000(ms)

More

  • 支持typescript类型, 并发布到@types/react-textscroll
  • 后续支持JS/CSS两种实现方式,并可自由切换
  • text支持传入react组件
  • 手动控制暂停、开始,通过static property实现

react-textscroll's People

Contributors

cacivy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-textscroll's Issues

yarn add 时报错了

作者你好,我在项目中 yarn add 时报错了,请问是怎么回事呢?
WX20190821-111721

请问下. 这个组件是否能支持 ssr?

我在 next.js 项目中引入 此项目, 会报错.

所以想确认下 在其他ssr 项目中 是否能使用? 看了下报错信息. 貌似是 styled 未配置 服务端的功能

我也在使用 styled 在服务端中使用它,配置有点麻烦.

有什么好的建议吗?

目前的替代方案是 : animate.css 有点丑陋

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.