Marketing sectionsMarqueeTitle
Searchastronomic.dev# MarqueeTitle
For one huge title that scrolls across the page as decoration; a real heading carries the words.
Interactive: inline script.
## Usage
```astro
import MarqueeTitle from "@astronomic-dev/ui/components/MarqueeTitle.astro";
```
## Examples
### A moving title
One title in display type, sized so a copy fills the row's width, passing by with a small accent dot between copies. The heading is real but visually hidden. With motion off, one copy fits the row.
```astro
---
import MarqueeTitle from "@astronomic-dev/ui/components/MarqueeTitle.astro";
---
<div class="py-12">
<MarqueeTitle heading="Selected work" />
</div>
```
### A longer title
A longer title gets smaller, so one copy still fits the row at any width, even 320px. marker={Star}: your icon in place of the dot.
```astro
---
import MarqueeTitle from "@astronomic-dev/ui/components/MarqueeTitle.astro";
import Star from "../../logos/astronomic-star.svg";
---
<div class="py-12">
<MarqueeTitle heading="Every part of Astronomic UI" marker={Star} speed="slow" />
</div>
```
## Props
### MarqueeTitle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | Required. The title, such as "Selected work": a real heading, visually hidden, carries it, and the moving copies show it. An empty heading stops the build. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. |
| `marker` | `IconComponent` | None | The mark after each copy: your icon component (e.g. a star), half the title's height, in the text color. Without it, a dot in the accent. Decorative. |
| `speed` | `"slow" \| "normal" \| "fast"` | None | How long one loop takes: the theme's --ui-marquee-duration (40s when it sets none) times 1.5, 1 or 0.6. Normal by default. |
| `direction` | `"start" \| "end"` | None | start (the default) runs toward the start of the line; end the other way. |
| `pause` | `boolean` | `false` | Shows the page's one MotionPause button above the title (the heading stays hidden). Pass it only when this is the page's first marquee. |
| `class` | `string` | None | More classes for the <section>, merged with cn(), so yours win on conflicts. The root is a named size container. |
Any other attribute goes on the <section>.
## Accessibility
- It is a region named by its heading, which is a real heading element, visually hidden: a screen reader hears the title once, and it is in the page's outline.
- The moving copies are decoration, hidden from screen readers as a whole; the second copy is inert too.
- Still with no click needed when the reader asks for reduced motion or the theme is calm: one copy, fitted to the row.
- Anything that moves for more than five seconds needs a way to stop it (WCAG 2.2.2): pass pause when it is the page's first marquee.
MarqueeTitle
FreeFor one huge title that scrolls across the page as decoration; a real heading carries the words.
- File
- MarqueeTitle.astro
- Group
- Marketing sections
- Kind
- Interactive: inline script
- Examples
- 2
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
A moving title
One title in display type, sized so a copy fills the row's width, passing by with a small accent dot between copies. The heading is real but visually hidden. With motion off, one copy fits the row.
This preview did not load.
main.astro
examples/marqueetitle/main.astro
---
import MarqueeTitle from "@astronomic-dev/ui/components/MarqueeTitle.astro";
---
<div class="py-12">
<MarqueeTitle heading="Selected work" />
</div>A longer title
A longer title gets smaller, so one copy still fits the row at any width, even 320px. marker={Star}: your icon in place of the dot.
This preview did not load.
long.astro
examples/marqueetitle/long.astro
---
import MarqueeTitle from "@astronomic-dev/ui/components/MarqueeTitle.astro";
import Star from "../../logos/astronomic-star.svg";
---
<div class="py-12">
<MarqueeTitle heading="Every part of Astronomic UI" marker={Star} speed="slow" />
</div>Minimal · Light