1.0.0 • Published 4 years ago

svelte-ticker v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Svelte Ticker for Svelte 3 demo

NPM version NPM downloads

Simple Svelte component which automatically makes its contents scrollable ticker-style if it's necessary. Looks like html <marquee> tag but much better. Can be useful for such things like News Tickers etc.

Features

  • 4 directions
  • duration & delay
  • responsive
  • infinity or exact looping
  • pausing on hover

Install

npm i svelte-ticker --save-dev
yarn add svelte-ticker

CDN: UNPKG | jsDelivr (available as window.Ticker)

Usage

<Ticker>
    <strong>Your very long string here or even html elements</strong>
</Ticker>

<script>
    import Ticker from 'svelte-ticker';
</script>

If you are not using using es6, instead of importing add

<script src="/path/to/svelte-ticker/index.js"></script>

just before closing body tag.

API

Props

NameTypeDescriptionRequiredDefault
directionStringPossible values: 'left', 'right', 'top', 'bottom'Noleft
durationNumberAnimation duration in secondsNo30
delayNumberDelay before animation goes in secondsNo0
loopBoolean / NumberDetermines should the animation be looped or played number the times.Notrue
pausingBooleanDetermines should the animation be paused on hoverNotrue
alternateBooleanDetermines should the animation be played forwards first, then backwardsNofalse
behaviorStringPossible values: 'auto' and 'always'Noauto

License

MIT © PaulMaly