Skip to main content
Vuetify0 is now in alpha!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Overflow

Headless responsive truncation primitive. Children render until the container runs out of width, then overflowing items are hidden and an indicator surfaces the hidden count.

Usage

Overflow is built on the createOverflow composable. Wrap any horizontal list of items with Overflow.Root, register each item via Overflow.Item, and add an Overflow.Indicator to render the +N more affordance when truncation kicks in.

vue
<script setup lang="ts">
  import { Overflow } from '@vuetify/v0'

  const tags = ['Vue', 'React', 'Svelte', 'Solid', 'Qwik']
</script>

<template>
  <Overflow.Root class="flex gap-2 overflow-hidden">
    <Overflow.Item v-for="tag in tags" :key="tag" :value="tag">
      {{ tag }}
    </Overflow.Item>

    <Overflow.Indicator v-slot="{ count }">
      +{{ count }} more
    </Overflow.Indicator>
  </Overflow.Root>
</template>

Anatomy

Anatomy
<script setup lang="ts">
  import { Overflow } from '@vuetify/v0'
</script>

<template>
  <Overflow.Root>
    <Overflow.Item />

    <Overflow.Indicator />
  </Overflow.Root>
</template>

Examples

Tags

The canonical use case. As the container shrinks, trailing tags hide and an indicator counts how many are missing. The default priority="start" keeps leading items visible — natural for tag chips, filters, and breadcrumb-style lists where the first items are the most relevant.

The container needs overflow: hidden so the natural layout doesn’t push items out of frame before the component can react. The indicator’s slot exposes count; you control its rendering completely.

FileRole
basic.vueTag row that overflows when the container narrows
TypeScriptVueReactSvelteAngularSolidQwikAstroNuxtNext.js

Avatar group

The classic “user roster” use case — a stack of overlapping avatars that collapse into a +N chip when the row gets tight. The data lives in a separate users.ts module to keep the markup focused on the visual composition. The overlap comes from per-avatar marginInlineStart: -8px, which createOverflow picks up automatically through getComputedStyle().marginLeft — the Overflow.Root doesn’t need to set the gap prop because the container has no CSS gap and the visual overlap is already in each item’s measured width.

Because each avatar has the same width, the trailing avatars drop in predictable order — no special configuration needed beyond the default priority="start". The indicator inherits the same circular shape and ring so it visually slots into the stack rather than calling attention to itself.

FileRole
users.tsSample user data (id, name, initials, hue)
avatar-group.vueOverlapping avatar stack with +N indicator
ALGHATLTMHDKBLTBEDKTDRBSBKJGAHYMBEGRLWRLJMMMCSJNNWTHRMFARPAGLCJSKJAEJCMWSSJBWHHL

Popover of hidden items

Overflow.Indicator exposes the array of currently-hidden tickets via the hidden slot prop. Wrap the indicator content in a Popover.Activator and render the hidden values inside Popover.Content to give users access to truncated content without losing the compact display.

This is the same pattern used by GitHub’s repo language list and Linear’s project tag list. The indicator only renders when overflow occurs, so the popover trigger naturally appears and disappears with the available space.

FileRole
popover.vueIndicator wrapping a Popover with hidden items
designengineeringproductresearchmarketingsalessupportfinancelegaloperationshradminsalesforcezendeskjiraconfluence

End priority

When the latest items matter most — chat reactions, recent activity, message lists — priority="end" flips the behavior: leading items hide first and the indicator naturally renders at the start. Visual order is preserved (DOM order = display order); only visibility flips.

Place the Overflow.Indicator first in source order so it renders to the left of the visible items. One tradeoff to keep in mind: the indicator’s aria-live="polite" region announces before the items it summarizes, so screen-reader users hear “+3 earlier” before the most recent entries. That’s usually correct for the “show me what’s new, but tell me how much I missed” reading model — but if your use case needs the items announced first, prefer priority="start" and place the indicator at the end. For breadcrumb-style “first + last, hide middle” bisecting, reach for Breadcrumbs instead — Overflow is deliberately one-sided.

FileRole
priority-end.vueRecent-messages style with end priority
2 weeks ago1 week ago4 days ago2 days ago1 day ago20 hours ago10 hours ago5 hours ago2 hours ago1 hour ago

Recipes

Disable truncation conditionally

vue
<template>
  <Overflow.Root :disabled="showAll">
    <Overflow.Item v-for="t in tags" :key="t" :value="t">
      {{ t }}
    </Overflow.Item>
  </Overflow.Root>

  <button @click="showAll = !showAll">
    {{ showAll ? 'Collapse' : 'Show all' }}
  </button>
</template>

Pin specific items so they always render

vue
<template>
  <Overflow.Root>
    <Overflow.Item v-for="item in items" :key="item.id" :disabled="item.pinned">
      {{ item.label }}
    </Overflow.Item>
  </Overflow.Root>
</template>

A disabled Item is exempt from capacity math and always renders.

Accessibility

ConcernMechanism
Hidden items announced to ATItems receive aria-hidden="true" when off-capacity
Indicator announcementsaria-live="polite" on the indicator’s element
Container semanticsOverflow.Root defaults to <div>; pass as="ul" and as="li" on Items for list semantics

FAQ

API Reference

The following API details are for all variations of the Overflow component.

Overflow.Root

Props

namespace

string | undefined

Namespace for dependency injection

Default: "v0:overflow"

gap

number | undefined

Pixel gap between items (mirror of CSS gap)

Default: 0

priority

any

Side that keeps items when overflow occurs

Default: "start"

disabled

boolean | undefined

Disable truncation; render everything

Default: false

Slots

default

OverflowRootSlotProps

Overflow.Indicator

Props

namespace

string | undefined

Namespace for dependency injection

Default: "v0:overflow"

Slots

default

OverflowIndicatorSlotProps

Overflow.Item

Props

namespace

string | undefined

Namespace for dependency injection

Default: "v0:overflow"

value

unknown

Value associated with this ticket (defaults to index)

disabled

boolean | undefined

Skip from capacity calculation; always rendered visibly

Default: false

Slots

default

OverflowItemSlotProps
Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/