This component no longer exists. It was in diceui/base’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-13 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
avatar-group
diceui-base/avatar-groupRemovedComponent
diceui/base publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/base-vega/avatar-group.jsonSource
1import { mergeProps } from "@base-ui/react/merge-props";2import { useRender } from "@base-ui/react/use-render";3import { cva, type VariantProps } from "class-variance-authority";4import * as React from "react";5import { cn } from "@/lib/utils";67const avatarGroupVariants = cva("flex items-center", {8 variants: {9 orientation: {10 horizontal: "flex-row",11 vertical: "flex-col",12 },13 dir: {14 ltr: "",15 rtl: "",16 },17 },18 compoundVariants: [19 {20 orientation: "horizontal",21 dir: "ltr",22 className: "-space-x-1",23 },24 {25 orientation: "horizontal",26 dir: "rtl",27 className: "flex-row-reverse -space-x-1 space-x-reverse",28 },29 {30 orientation: "vertical",31 dir: "ltr",32 className: "-space-y-1",33 },34 {35 orientation: "vertical",36 dir: "rtl",37 className: "flex-col-reverse -space-y-1 space-y-reverse",38 },39 ],40 defaultVariants: {41 orientation: "horizontal",42 dir: "ltr",43 },44});4546interface AvatarGroupProps47 extends Omit<React.ComponentProps<"div">, "dir">,48 Omit<VariantProps<typeof avatarGroupVariants>, "dir">,49 useRender.ComponentProps<"div"> {50 dir?: "ltr" | "rtl";51 size?: number;52 max?: number;53 reverse?: boolean;54 renderOverflow?: (count: number) => React.ReactNode;55}5657function AvatarGroup(props: AvatarGroupProps) {58 const {59 orientation = "horizontal",60 dir = "ltr",61 size = 40,62 max,63 reverse = false,64 renderOverflow,65 className,66 children,67 render,68 ...rootProps69 } = props;7071 const childrenArray = React.Children.toArray(children).filter(72 React.isValidElement,73 );74 const itemCount = childrenArray.length;75 const shouldTruncate = max && itemCount > max;76 const visibleItems = shouldTruncate77 ? childrenArray.slice(0, max - 1)78 : childrenArray;79 const overflowCount = shouldTruncate ? itemCount - (max - 1) : 0;80 const totalRenderedItems = shouldTruncate ? max : itemCount;8182 return useRender({83 defaultTagName: "div",84 props: mergeProps<"div">(85 {86 className: cn(avatarGroupVariants({ orientation, dir, className })),87 children: (88 <>89 {visibleItems.map((child, index) => (90 <AvatarGroupItem91 key={index}92 child={child}93 index={index}94 itemCount={totalRenderedItems}95 orientation={orientation}96 dir={dir}97 size={size}98// … truncated
What it pulls in
npm packages
