Customising Navigation Arrows and Dots in Owl Carousel

Laptop showing a travel journal carousel with large green navigation arrows and pill-shaped pagination dots

The default controls work well, but most projects eventually need arrows and dots that match the surrounding design. Owl Carousel exposes several options for this, from simple text changes to moving the controls into entirely separate containers.

The Role of Navigation in a Carousel

Navigation controls do two jobs. They let people move through the slides, and they communicate how much content exists and where the visitor currently is. Arrows serve the first purpose well, while dots serve the second, acting as a compact progress indicator. On a carousel with dozens of items, however, a long row of dots stops being informative and becomes clutter, which is why options such as dotsEach and slideBy exist.

Good controls are also discoverable. Arrows that blend into the slide behind them, or dots too small to tap, quietly reduce how many slides people actually see. Contrast, size and placement deserve as much attention as the visual style of the buttons themselves.

Enabling the Controls

Arrows are disabled by default and dots are enabled. Each has its own boolean option:

$(".owl-carousel").owlCarousel({
  nav: true,
  dots: true
});

Changing the Arrow Content

The navText option accepts an array of two strings, which may contain HTML. This is the simplest way to use icon fonts or inline SVG in place of the default labels.

navText: [
  '<span aria-hidden="true">&lsaquo;</span>',
  '<span aria-hidden="true">&rsaquo;</span>'
]

Placing Controls Elsewhere

By default the library injects the controls inside the carousel. To place them in a toolbar, beside a heading or below the slider, point navContainer and dotsContainer at existing elements. The library then renders its buttons inside those elements while still managing their state.

<div class="slider-controls">
  <div id="custom-nav"></div>
  <div id="custom-dots"></div>
</div>

$(".owl-carousel").owlCarousel({
  nav: true,
  navContainer: "#custom-nav",
  dotsContainer: "#custom-dots"
});

Controlling How Far Each Click Moves

The slideBy option sets how many items advance with each arrow click. A number moves that many items, while the string "page" moves a full screen of items at once, which feels natural for product rows. The dotsEach option reduces the number of dots by grouping items, preventing a long, unwieldy row on large carousels.

Custom Dot Content

Setting dotsData: true tells the library to read the content of each dot from a data-dot attribute on the corresponding slide. This allows thumbnails, numbers or short labels to serve as pagination.

<div class="item" data-dot="<span>01</span>">…</div>
<div class="item" data-dot="<span>02</span>">…</div>

Styling the Controls

The default theme targets .owl-nav button.owl-prev, .owl-nav button.owl-next and .owl-dots .owl-dot span. Override these selectors in your own stylesheet, loaded after the theme, rather than editing the theme file directly. Doing so keeps upgrades straightforward. The library adds a disabled class to arrows at the start and end of a non-looping carousel, which you can style to signal that no further movement is possible.

Accessibility Considerations

Arrow buttons need a text alternative for screen reader users. If navText contains only symbols or icons, add an aria-label to each button after initialisation:

$(".owl-carousel").on("initialized.owl.carousel", function () {
  $(this).find(".owl-prev").attr("aria-label", "Previous slide");
  $(this).find(".owl-next").attr("aria-label", "Next slide");
}).owlCarousel({ nav: true });

Ensure the buttons have a visible focus state and sufficient colour contrast against the slides behind them, and keep their touch targets at least 44 pixels square on mobile devices.

Building Fully Custom Buttons

For complete control over markup, leave the built-in arrows switched off and create your own buttons. Triggering the library's events moves the carousel, and listening for the changed event keeps the buttons' disabled state accurate on a non-looping carousel.

<button class="slider-prev" type="button" aria-label="Previous slide">&larr;</button>
<button class="slider-next" type="button" aria-label="Next slide">&rarr;</button>

var owl = $(".owl-carousel");

owl.on("initialized.owl.carousel changed.owl.carousel", function (e) {
  if (!e.namespace || !e.page) return;
  $(".slider-prev").prop("disabled", e.page.index <= 0);
  $(".slider-next").prop("disabled", e.page.index >= e.page.count - 1);
}).owlCarousel({ items: 3, slideBy: "page", dots: false });

$(".slider-prev").on("click", function () { owl.trigger("prev.owl.carousel"); });
$(".slider-next").on("click", function () { owl.trigger("next.owl.carousel"); });

Positioning the Default Arrows

A frequent design request is to place the arrows on either side of the slides, vertically centred. Because the library renders them inside .owl-nav, a few lines of CSS achieve this without any extra markup:

.owl-carousel { position: relative; }

.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.owl-carousel .owl-nav button.owl-prev { left: -22px; }
.owl-carousel .owl-nav button.owl-next { right: -22px; }

Thumbnail Navigation

Galleries often pair a large carousel with a row of thumbnails. Two carousels can be linked so that selecting a thumbnail moves the main slider, and moving the main slider highlights the matching thumbnail:

var main = $(".gallery-main").owlCarousel({ items: 1, nav: true, dots: false });
var thumbs = $(".gallery-thumbs").owlCarousel({ items: 5, margin: 8, dots: false });

main.on("changed.owl.carousel", function (e) {
  if (e.property.name !== "position") return;
  var i = e.item.index;
  thumbs.find(".owl-item").removeClass("current").eq(i).addClass("current");
  thumbs.trigger("to.owl.carousel", [i, 300]);
});

thumbs.on("click", ".owl-item", function () {
  main.trigger("to.owl.carousel", [$(this).index(), 300]);
});

Keep looping disabled on both carousels in this pattern, because clones would make the index positions of the two sliders diverge.

Keyboard Support

The library does not add keyboard shortcuts by default. Making the carousel focusable and responding to the arrow keys gives keyboard users the same ease of movement that mouse and touch users enjoy:

$(".owl-carousel")
  .attr({ tabindex: 0, "aria-roledescription": "carousel" })
  .on("keydown", function (e) {
    if (e.key === "ArrowLeft")  $(this).trigger("prev.owl.carousel");
    if (e.key === "ArrowRight") $(this).trigger("next.owl.carousel");
  });

Key Takeaways

  • Use navText for quick changes and the container options for layout freedom.
  • slideBy: "page" and dotsEach keep controls manageable on long carousels.
  • Icon-only buttons need an accessible name.
  • Keyboard support takes only a few lines and benefits many visitors.

Summary

Use navText for quick changes, the container options for layout freedom and dotsData for richer pagination. Pair every visual change with a check of keyboard and screen reader behaviour.