React Advanced News Ticker

  • A powerful, flexible and animated vertical news ticker component.
  • Provides hight flexibility thanks to numerous callbacks & methods.
  • Fully customizable to every kind of vertical scrolling need.
  • Light-weight and used only React and JavaScript.

Examples

Multilines Simple Example

  • Maecenas nec ligula sed est suscipit aliquet sed eget ipsum, suspendisse. Read more...
  • Etiam imperdiet volutpat libero eu tristique. Aenean, rutrum felis in. Read more...
  • Praesent ornare nisl lorem, ut condimentum lectus gravida ut. Read more...
  • In pharetra suscipit orci sed viverra. Praesent at sollicitudin tortor, id. Read more...
Show CSS

One Line Ticker With Callbacks & Methods Example

Show CSS
  • 10:02 Praesent ornare nisl lorem, ut condi.
  • 10:14 Nunc ultrices tortor eu massa placerat posuere.
  • 11:23 Morbi sodales tellus sit amet leo congue bibendum.
  • 11:45 In pharetra suscipit orci sed viverra. Praesent at.
  • 11:55 Maecenas nec ligula sed est suscipit aliquet sed.
  • 12:00 Onec bibendum consectetur diam, nec eui.
  • 08:12 Etiam imperdiet volutpat libero eu tristique.
  • 08:41 Curabitur porttitor ante eget hendrerit adipi.
10:02
Vestibulum ac interdum quam, tempus aliquet purus. Nunc luctus augue ut pellentesque faucibus. Proin urna nunc, feugiat ac bibendum non, cursus id orci. Integer porttitor diam et odio pharetra, sed congue augue dapibus. Fusce ac tristique tortor. Aliquam adipiscing ligula in dui pretium ultrices.

Bonus: "Roulette" Example, Using Callbacks & Methods

  • PHARETRA
  • MAECENAS
  • ONEC
  • LOREM
  • IPSUM
  • PRAESENT
  • NUNC
Start
Show CSS

Usage

Import react advanced news ticker:
Basically create NewsTicker element and give your components as children. You can also use your own custom componets.
With custom parameters:
With callbacks:
With methods. You need to use ref for using methods.

Props

ParameterUsageType/ValuesDefault
rowHeightdefines the height (in px) of one rowint22
maxRowsdefines the number of rows displayed at the same timeint3
speeddefines the animation speed (in ms)of the rows moving up or downint (in ms)400
durationdefines the times (in ms) before the rows automatically moveint (in ms)2500
directiondefines the direction of the rows movementDirections.UP or Directions.DOWNDirections.UP
autoStartenable/disable auto start on loadbooltrue
pauseOnHoverenable/disable pause when mouse hovers the newsTicker elementbooltrue
classNamefor define className of newsTicker's ul element string''
idfor define id of newsTicker's ul element string''
stylefor styling newsTicker's ul element object{}
hasMovedcallback called at the end of every movement animationfunction
movingUpcallback called before launching moving up actionfunction
movingDowncallback called before launching moving down actionfunction
startedcallback called on start actionfunction
stoppedcallback called on stop actionfunction
pausedcallback called on pause action (triggered on onMouseEnter if pauseOnHover=true)function
unPausedcalled on unpause action (triggered on onMouseLeave if pauseOnHover=true)function

Methods

After creating NewsTicker component with ref, methods are called with
Example

Method List

MethodParameter(s)Action
startstarts moving newsTicker elements
stopstops moving newsTicker elements
getStatereturns current state: TickerStates.Stopped = stopped, TickerStates.Running = started, TickerStates.Paused = paused (and started)
pausepauses newsTicker elements without stopping them - the newsTicker has to be started to be able to pause it (the pause method is called on mouseOver if pauseOnHover = true)
unpauseunpauses newsTicker elements - the newsTicker has to be started & paused to be able to unpause it (the unpause method is called on onMouseLeave if pauseOnHover = true)
moveDownmoves elements down
moveUpmoves elements up
moveNextmoves up or down according to the current direction option
movePrevmoves up or down according to the current direction option
moveequivalent to moveNext, but will not move if paused
Developed by Ahmet Can Aydemir