Marketing sectionsMarqueeText
Searchastronomic.dev# MarqueeText
For a band of short phrases that scroll, such as your services.
Interactive: inline script.
## Usage
```astro
import MarqueeText from "@astronomic-dev/ui/components/MarqueeText.astro";
```
## Examples
### A band of phrases
Short phrases in the subhead role, a small accent dot after each, under a label. It runs toward the end of the line here (direction="end").
```astro
---
import MarqueeText from "@astronomic-dev/ui/components/MarqueeText.astro";
const services = ["Brand identity", "Websites", "Editorial design", "Motion", "Design systems"];
---
<div class="mx-auto max-w-6xl px-6 py-12">
<MarqueeText label="What we do" items={services} direction="end" />
</div>
```
## Props
### MarqueeText
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `string[]` | None | Required. The phrases, in order, such as your services. Keep each to a few words. An empty list stops the build. |
| `marker` | `IconComponent` | None | The mark after each phrase: your icon component (e.g. a star), in the text color. Without it, a small dot in the accent. Decorative. |
| `label` | `string` | None | The region's name, such as "Recent clients", in small muted type above the row (or beside it, in MarqueeLogos). With a heading, the heading names the region instead. One of heading, label or labelledBy is required: without any the build stops. |
| `labelledBy` | `string` | None | The id of your own element that names the region, such as a label you show beside the strip. With it the part shows no label of its own and the region is named by your element only, so a screen reader hears the name once (MarqueeLogos then takes no labelLayout). One of heading, label or labelledBy is required; a heading wins over it. |
| `heading` | `string` | None | The section heading, in the section role in display type. With it, it names the region. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside. Off by default, so the heading shows as typed. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)", in small muted type, outside the heading. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 clients": the mark is then hidden from screen readers and this is read in its place. |
| `text` | `string` | None | One or two sentences under the heading, in the lead role, muted. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. |
| `speed` | `"slow" \| "normal" \| "fast"` | `"normal"` | How long one loop takes: the theme's --ui-marquee-duration (40s when it sets none) times 1.5 for slow, 1 for normal or 0.6 for fast. |
| `direction` | `"start" \| "end"` | `"start"` | start: the row runs toward the start of the line (left, or right on a right-to-left page). end: the other way. |
| `pause` | `boolean` | `false` | Shows the page's one MotionPause button in the header. Pass it on the first marquee of the page only: one button stops every marquee and autoplaying video. |
| `class` | `string` | None | More classes for the <section>, merged with cn(), so yours win on conflicts. The root is a named size container (inline-size containment): in a shrink-to-fit parent it collapses, so give it a width there. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
Any other attribute goes on the <section>.
## Accessibility
- It is a region (<section>) named by its heading or its label: one of them is required. The heading id is unique on the page.
- The items are a list, written twice: the first copy is the real list, the second is hidden from screen readers (aria-hidden) and inert, so a screen reader hears each item once and the Tab key reaches each link once.
- The moving row takes no focus of its own; the links inside it do. Hovering it pauses it, so a link never slides away from the pointer. Focusing a link inside it turns it still: the copy hides and the set wraps in rows, as with reduced motion, so the focused link sits whole and in view; it moves again when focus leaves.
- Still with no click needed when the reader asks for reduced motion or the theme is calm: one copy of the list, wrapping onto more lines, with nothing hidden.
- Anything that moves for more than five seconds needs a way to stop it (WCAG 2.2.2): pass pause on the page's first marquee for the one Pause motion button, which stops every marquee for the visit.
- Right to left, the row runs the other way, so start is still the start of the line.
- The marker after each phrase is decoration, hidden from screen readers.
MarqueeText
FreeFor a band of short phrases that scroll, such as your services.
- File
- MarqueeText.astro
- Group
- Marketing sections
- Kind
- Interactive: inline script
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
A band of phrases
Short phrases in the subhead role, a small accent dot after each, under a label. It runs toward the end of the line here (direction="end").
This preview did not load.
main.astro
examples/marqueetext/main.astro
---
import MarqueeText from "@astronomic-dev/ui/components/MarqueeText.astro";
const services = ["Brand identity", "Websites", "Editorial design", "Motion", "Design systems"];
---
<div class="mx-auto max-w-6xl px-6 py-12">
<MarqueeText label="What we do" items={services} direction="end" />
</div>Minimal · Light