Skip to content

feat(VAvatarGroup): add strictLimit prop to make limit include overflow avatar#22703

Closed
levibeeck wants to merge 1 commit intovuetifyjs:masterfrom
levibeeck:master
Closed

feat(VAvatarGroup): add strictLimit prop to make limit include overflow avatar#22703
levibeeck wants to merge 1 commit intovuetifyjs:masterfrom
levibeeck:master

Conversation

@levibeeck
Copy link
Copy Markdown

Description

Added a prop to enforce the limit as the max total number of avatars actually rendered (including the overflow indicator) while preserving current limit logic rendering the overflow indicator additionally to the limit.

resolves #22702

Markup:

<template>
    <v-app>
        <v-container class="d-flex flex-column gr-4">
            <h3>Example using limit of "4"</h3>
            <h4>Without strict (renders 5 avatars, of which the last is useless containing "+1")</h4>
            <div class="d-flex align-center gc-4">
                <v-avatar-group
                    border="md surface opacity-100"
                    :items="items"
                    :limit="4"
                />
            </div>
            <h4>With strict (renders 4 avatars)</h4>
            <div class="d-flex align-center gc-4">
                <v-avatar-group
                    border="md surface opacity-100"
                    :items="items"
                    :limit="4"
                    strict-limit
                />
            </div>
        </v-container>
    </v-app>
</template>

<script setup>
import { VAvatarGroup } from '../src/labs/VAvatarGroup'
const items = [
    { image: 'https://vuetifyjs.b-cdn.net/docs/images/one/snips/avatars/3.jpg' },
    { image: 'https://vuetifyjs.b-cdn.net/docs/images/one/snips/avatars/4.jpg' },
    { icon: 'mdi-account', color: 'info' },
    { text: 'JD', color: 'primary' },
    { icon: 'mdi-account', color: 'success' },
]
</script>

Added a prop to enforce the limit as the max total number of avatars actually rendered while preserving current limit logic rendering the overflow indicator additionally to the limit.

Also, adjusted the usage description of the limit prop in the api and docs slightly.

resolves vuetifyjs#22702
@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Mar 10, 2026

Two very similar props might end up hurting us more than helping. Since the component is still in labs, we are allowed to introduce breaking changes. Can you adapt the PR to make it fix the original limit prop?

@J-Sek J-Sek added T: bug Functionality that does not work as intended/expected C: VAvatarGroup labels Mar 10, 2026
@J-Sek J-Sek closed this in e580ebc Mar 11, 2026
J-Sek added a commit that referenced this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VAvatarGroup T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Clarify VAvatarGroup limit prop to consistently limit rendered avatars

2 participants