marquee-strip
A strip that scrolls its content sideways without end, for logos or testimonials. Seamless (a hidden copy), pauses on hover and focus, controls adds a pause button, and it stands still and scrolls by hand for visitors who asked for less motion.
This one has no events: it shows what it's given.
Source: marquee-strip.zb, and its registry item.
Install
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/marquee-strip.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/marquee-strip.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/marquee-strip.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/marquee-strip.json
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/marquee-strip.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/marquee-strip.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/marquee-strip.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/marquee-strip.json
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/marquee-strip.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/marquee-strip.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/marquee-strip.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/marquee-strip.json
<link rel="stylesheet" href="https://zubra-js.github.io/zubra-ui/themes/default.css">
<script type="module" src="https://zubra-js.github.io/zubra-ui/cdn/marquee-strip.js"></script>The compiled install writes src/components/zubra/marquee-strip.js and the theme, and adds @zubra/runtime to your dependencies. The one-file install writes the same path as a plain custom element that needs nothing installed (or download it and load it with a <script type="module">); it's smaller on a page with one to three components, the shared runtime with more.
Usage
<marquee-strip label="Bakeries using Bakehouse" gap="1rem">
<span class="demo-chip">Northwind</span>
<span class="demo-chip">Rise & Crumb</span>
<span class="demo-chip">Globex</span>
<span class="demo-chip">Initech</span>
<span class="demo-chip">Umbrella</span>
<span class="demo-chip">Hooli</span>
</marquee-strip>
<script type="module">
import './components/zubra/marquee-strip.js';
const element = document.querySelector('marquee-strip');
element.duration = 24;
</script>import './components/zubra/marquee-strip.js';
const duration = 24;
export function MarqueeStripExample() {
return (
<marquee-strip
label="Bakeries using Bakehouse"
gap="1rem"
duration={duration}
>
<span className="demo-chip">Northwind</span>
<span className="demo-chip">Rise & Crumb</span>
<span className="demo-chip">Globex</span>
<span className="demo-chip">Initech</span>
<span className="demo-chip">Umbrella</span>
<span className="demo-chip">Hooli</span>
</marquee-strip>
);
}<script setup>
import './components/zubra/marquee-strip.js';
const duration = 24;
</script>
<template>
<marquee-strip
label="Bakeries using Bakehouse"
gap="1rem"
:duration.prop="duration"
>
<span class="demo-chip">Northwind</span>
<span class="demo-chip">Rise & Crumb</span>
<span class="demo-chip">Globex</span>
<span class="demo-chip">Initech</span>
<span class="demo-chip">Umbrella</span>
<span class="demo-chip">Hooli</span>
</marquee-strip>
</template>
<!-- vite.config.js: vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.includes('-') } } }) --><script>
import './components/zubra/marquee-strip.js';
const duration = 24;
</script>
<marquee-strip label="Bakeries using Bakehouse" gap="1rem" {duration}>
<span class="demo-chip">Northwind</span>
<span class="demo-chip">Rise & Crumb</span>
<span class="demo-chip">Globex</span>
<span class="demo-chip">Initech</span>
<span class="demo-chip">Umbrella</span>
<span class="demo-chip">Hooli</span>
</marquee-strip>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import './components/zubra/marquee-strip.js';
@Component({
selector: 'app-marquee-strip-example',
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<marquee-strip
label="Bakeries using Bakehouse"
gap="1rem"
[duration]="duration"
>
<span class="demo-chip">Northwind</span>
<span class="demo-chip">Rise & Crumb</span>
<span class="demo-chip">Globex</span>
<span class="demo-chip">Initech</span>
<span class="demo-chip">Umbrella</span>
<span class="demo-chip">Hooli</span>
</marquee-strip>
`,
})
export class MarqueeStripExample {
duration = 24;
}API
| Property | Type | Default |
|---|---|---|
duration | number | 30 |
gap | string | "2.5rem" |
reverse | boolean | false |
controls | boolean | false |
label | string | "" |
| Slot | For |
|---|---|
(default) | The items, side by side. |
Size
1.5 KB gzipped for the component, plus the runtime, which every Zubra component on a page shares (up to 22.1 KB, all of it). On its own, with the parts of the runtime it uses, it's 18.1 KB.