Embla Carousel Vertical News Ticker — Free Headline Rotator Snippet

Embla Carousel Vertical News Ticker · Carousels · Plain HTML, CSS & JS · Live preview

What's included

Features

Vertical axis
axis: 'y' with a column container.
Fixed one-line viewport
Explicit height shows one headline.
Autoplay rotation
Looping, with hover pause.
Manual controls
Up, down and pause buttons.
Vertical dragging
touch-action tuned for the Y axis.
Quiet for screen readers
aria-live off; visible link only in tab order.
Focus pause
Keyboard users get the same pause as mouse users.
One-line truncation
Ellipsis keeps height stable.

About this UI Snippet

Embla Vertical Carousel — A News Ticker That Rolls Upward

Screenshot of the Embla Carousel Vertical News Ticker snippet rendered live

A single-line ticker that rolls headlines upward is a compact way to show a stream of updates: news, status messages, recent orders, or announcements. Embla's axis: 'y' option makes this a normal carousel turned on its side, with dragging, looping and plugins all still available.

What changes for a vertical carousel

Three things. The option axis: 'y' tells Embla to measure heights and translate vertically. The container becomes flex-direction: column. And the viewport needs an explicit height — here 56px, exactly one headline — because a column of slides has no natural height limit. touch-action: pan-x pinch-zoom flips the usual touch setting so vertical swipes drive the ticker while horizontal gestures stay with the page.

Autoplay for rotation

The Autoplay plugin advances every 3.5 seconds, loops, and pauses while the pointer is over the ticker. duration: 22 makes the roll quick, so headlines don't feel sluggish.

Pausing and accessibility

Rotating text is hard to read if it can't be stopped. The ticker has an explicit pause button, pauses on hover and while keyboard focus is inside, and doesn't autoplay for users who prefer reduced motion. The viewport is aria-live="off", so screen readers aren't interrupted by every rotation, and only the visible headline's link is in the tab order.

Manual control

Up and down buttons call scrollPrev() and scrollNext(), and dragging the ticker vertically works too.

Truncation

Long headlines are clipped with text-overflow: ellipsis on one line, so the ticker height never changes.

Build with AI

Build, Understand, Optimize, and Extend It With AI

Paste this snippet into an AI assistant like Claude and ask it which three changes make an Embla carousel vertical and why the viewport needs a fixed height. Ask it to fetch headlines from an RSS or JSON endpoint and insert new ones with embla.reInit(), to show a "3 new" badge, or to switch to a horizontal marquee on wide screens. It can also review the accessibility choices against WCAG 2.2.2.

Prompt to recreate it

Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:

text
Build a one-line vertical news ticker with Embla Carousel v8 and its Autoplay plugin (loaded from a CDN as UMD) in plain HTML, CSS and JavaScript.

Requirements:
- A card with a red "Breaking" label with a blinking dot, a ticker area and a control group.
- Six headlines with a time and a link, each truncated to one line with an ellipsis.
- Use Embla on the vertical axis with a flex-column container, a viewport exactly one headline tall, looping and a quick transition, with touch-action set for vertical swiping.
- Autoplay every 3.5 seconds, pausing on hover and while keyboard focus is inside, and not starting for users who prefer reduced motion.
- Up, down and pause/play buttons with accessible labels.
- Keep the ticker out of live announcements and make only the visible headline's link tabbable.

Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.

Source Code

<div class="evt">
  <div class="evt-card">
    <div class="evt-label"><span class="evt-live"></span>Breaking</div>
    <div class="evt-viewport" id="evtViewport" aria-live="off">
      <div class="evt-container" id="evtList"></div>
    </div>
    <div class="evt-ctrl">
      <button type="button" id="evtUp" aria-label="Previous headline">▲</button>
      <button type="button" id="evtDown" aria-label="Next headline">▼</button>
      <button type="button" id="evtPause" aria-label="Pause ticker">❚❚</button>
    </div>
  </div>
  <p class="evt-note">Headlines rotate every 3.5 s · hover, focus or press pause to stop</p>
</div>

Step by step

How to Use

  1. 1
    Load Embla and AutoplayInclude both UMD builds from the CDN.
  2. 2
    Paste the snippetHeadlines roll upward every 3.5 seconds.
  3. 3
    Control itUse the up/down arrows, pause button, or drag vertically.
  4. 4
    Feed your dataReplace NEWS with [time, headline] pairs and real links.
  5. 5
    Change paceAdjust delay in the Autoplay options and duration in Embla's.

Real-world uses

Common Use Cases

News and media sites
Breaking headlines bar.
E-commerce
Recent orders or promotions.
Status pages
Rolling incident updates.
Dashboards
Latest events in one line.
Event sites
Live schedule updates.
Related: Announcement Bar
A single static message bar: Announcement Bar.
Related: Swiper Vertical Full-Page Slider
Vertical slides at full-page scale: Swiper Vertical Full-Page Slider with Wheel Release.

Got questions?

Frequently Asked Questions

Pass axis: 'y' in the options, make the container a flex column, and give the viewport a fixed height. Embla then measures slide heights and scrolls vertically.

The viewport needs an explicit height and overflow hidden. Without a height, a column of slides simply grows to fit all of them.

Use touch-action: pan-x pinch-zoom on the container, the opposite of the horizontal setting, so vertical swipes drive the carousel and horizontal ones stay with the page.

Usually not. Announcing every rotation interrupts screen reader users. Keep the region aria-live="off", keep only the visible headline in the tab order, and provide a pause button.

Long enough to read the headline twice. Three to five seconds per line suits short headlines; allow more for longer text, and always let users pause.