npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svelte-neomarquee

v1.1.1

Published

![Static Badge](https://img.shields.io/badge/Svelte-orange?logo=svelte&logoColor=white) ![NPM Version](https://img.shields.io/npm/v/svelte-neomarquee) ![NPM Downloads](https://img.shields.io/npm/dw/svelte-neomarquee) ![NPM Type Definitions](https://img.sh

Downloads

21

Readme

svelte-neomarquee

Static Badge NPM Version NPM Downloads NPM Type Definitions NPM License

An event-driven and feature-rich marquee component for Svelte.

Motivation

Existing marquee libraries either lack of features, customization or ease of use. Its goal is to start from svelte-fast-marquee and svelte-marquee and leverage the UX and customization possibilities.

Features

  • Highly customizable
  • Strongly typed
  • Event-driven
  • TailwindCSS-compatible

Installation

# pnpm
pnpm i -D svelte-neomarquee
# npm
npm i -D svelte-neomarquee
# bun
bun i -D svelte-neomarquee
# yarn
yarn add -D svelte-neomarquee

Usage

Props

| Name | Type | Description | Mandatory | Default value | | :--------------------: | :-----------------------------------: | :-------------------------------------------------------------------------------------------------------------- | :-------: | :-----------: | | play | boolean | Whether the marquee should play | No | true | | playsCount | number | The number of times the marquee should play (0 = infinite) | No | 0 | | speed | number | The speed of the marquee, relative to its width/height | No | 100 | | direction | "left" \| "right" \| "up" \| "down" | The direction of the marquee | No | "right" | | mode | "single" \| "multiple" | Whether to repeat the slot content once or multiple times | No | "multiple" | | showGradient | boolean | Whether to show a gradient on both ends; takes precedence over showLeadingGradient and showTrailingGradient | No | false | | showLeadingGradient | boolean | Whether to show a gradient on the first edge; overwritten by showGradient | No | false | | showTrailingGradient | boolean | Whether to show a gradient on the last edge; overwritten by showGradient | No | false |

You can also pass:

  • style to add inline styles to the marquee container
  • class to add classes to the marquee container
  • any other prop, which will be passed to the marquee container

Additionally, you can bind clientWidth and clientHeight to get the width and height of the marquee container.

CSS variables

You can pass the following CSS variables through the style prop (or through class with TailwindCSS) to customize the marquee:

| Variable | Type | Description | Mandatory | Default value | | :----------------- | :----: | :-------------------------------------- | :-------: | :-----------------: | | --gap | string | The gap between elements in the marquee | No | 0 | | --gradient-width | string | The width of the gradient on both sides | No | 10% | | --gradient-color | string | The color of the gradient | No | black (#000000) |

Events

| Name | Description | Event detail's parameters | | :----------- | :----------------------------------------------------------------------------------- | :-------------------------------------------------------------- | | playstart | The marquee starts playing | None | | playpause | The marquee pauses playing (play set to false but animation not ended) | progress: the current progress, between 0 and 1 for each play | | playend | The marquee ends its animation (only triggered on animation end if playsCount > 0) | None | | progress | The current progress of the marquee, live-updated | progress: the current progress, between 0 and 1 for each play | | hoverstart | The mouse enters the marquee | None | | hoverend | The mouse leaves the marquee | None |

Slots

| Name | Description | | :--: | :---------------------------------- | | - | Elements to show inside the marquee |

Examples

Basic

<script>
	import Marquee from "svelte-neomarquee";
</script>

<Marquee>
	{#each Array(10) as _, i}
		<span>Element {i + 1}</span>
	{/each}
</Marquee>

Pause on hover

<script>
	import Marquee from "svelte-neomarquee";

	let play = true;
</script>

<Marquee bind:play on:hoverstart={() => (play = false)} on:hoverend={() => (play = true)}>
	...
</Marquee>

Custom speed

<script>
	import Marquee from "svelte-neomarquee";
</script>

<Marquee speed={200}>...</Marquee>

Custom gradient

<script>
	import Marquee from "$lib";
</script>

<Marquee showGradient style="--gradient-color: red; --gradient-width: 200px">...</Marquee>
<!-- or with TailwindCSS -->
<Marquee showGradient class="[--gradient-color:_red] [--gradient-width:_200px]">...</Marquee>

License

MIT