Skip to main content
Vuetify0 is now in beta!
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

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.
Was this page helpful?

Ctrl+/